When I run npm run start (as per https://preview.keenthemes.com/nodejs/metronic/docs/getting-started), receive this error:
> express-validator-tut@1.0.0 start
> nodemon app.js
'nodemon' is not recognized as an internal or external command,
operable program or batch file.
Hi,
Could you please try to run the command below?
npm install -g nodemon
# or if using yarn
yarn global add nodemon
Now I get this error:
Error: Cannot find module 'express'
Require stack:
- E:\Metronic\nodejs_demo1\starterkit\router\dashboard.js
- E:\Metronic\nodejs_demo1\starterkit\app.js
at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
at Module._load (node:internal/modules/cjs/loader:841:27)
at Module.require (node:internal/modules/cjs/loader:1061:19)
at require (node:internal/modules/cjs/helpers:103:18)
at Object.
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
at Module.load (node:internal/modules/cjs/loader:1037:32)
at Module._load (node:internal/modules/cjs/loader:878:12)
at Module.require (node:internal/modules/cjs/loader:1061:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'E:\\Metronic\\nodejs_demo1\\starterkit\\router\\dashboard.js',
'E:\\Metronic\\nodejs_demo1\\starterkit\\app.js'
]
}
Node.js v18.12.1
[nodemon] app crashed - waiting for file changes before starting...
---------------------
Also FYI using yarn command above (even though nodemon was successfully installed with npm) raises error:
Usage Error: The 'yarn global' commands have been removed in 2.x - consider using 'yarn dlx' or a third-party plugin instead
$ yarn run [--inspect] [--inspect-brk] [-T,--top-level] [-B,--binaries-only]
Hi,
Try to rerun yarn or npm install command once again from starterkit folder.
Regards,
Lauris Stepanovs,
Keenthemes Support Team
Thanks Lauris - yarn didn't work, but npm install did !
Hi,
Glad to hear that npm command worked for you.
If you want to fix yarn command, you can attach a message that you are getting so I can give you tips on a fix.
Regards,
Lauris Stepanovs,
Keenthemes Support Team