0

While setting the environment for the Vue.js app I have encountered the issue with npm start related to node_modules and nodemon. I am getting this error in the console when running the $npm start command:

$ npm start

> server@1.0.0 start C:\Users\Michał\desktop\it\vueapptrain\server
> node .node_modules/nodemon/.bin/nodemon.js src/app.js --exec 'npm run lint && node'

module.js:515
    throw err;
    ^

Error: Cannot find module 'C:\Users\Michał\desktop\it\vueapptrain\server\.node_modules\nodemon\.bin\nodemon.js'
    at Function.Module._resolveFilename (module.js:513:15)
    at Function.Module._load (module.js:463:25)
    at Function.Module.runMain (module.js:653:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! server@1.0.0 start: `node .node_modules/nodemon/.bin/nodemon.js src/app.js --exec 'npm run lint && node'`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the server@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Any ideas how this can be solved?

xhopkinsx
  • 1
  • 2

1 Answers1

1

Firstly, ensure you have nodemon installed; npm i nodemon -S.


Then, edit the start script in your package.json to this,

node ./node_modules/.bin/nodemon src/app.js --exec 'npm run lint && node'

  • Hi, Thanks a lot! There was a difference between the files structure and the node directory code, therefore the error occured. I have installed nodemon along with the eslint before. Now however I am facing other issue with the nodemon file: > server@1.0.0 start C:\Users\Michał\desktop\it\vueapptrain\server > node ./node_modules/.bin/nodemon src/app.js --exec 'npm run lint && node' C:\Users\Michał\desktop\it\vueapptrain\server\node_modules\.bin\nodemon:2 basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") ^^^^^^^ SyntaxError: missing ) after argument list – xhopkinsx Nov 01 '17 at 19:02