0

When I use npm run serve, I get following message.

PS C:\Users\Jan\Desktop\projektgruppe\Main> npm run serve

> editor@0.1.0 serve C:\Users\Jan\Desktop\projektgruppe\Main
> concurrently "nodemon -L --inspect=0.0.0.0:9001 ./server/index.js" "vue-cli-service build ./src/main.js --mode development --watch"
[0] Error occurred when executing command: nodemon -L --inspect=0.0.0.0:9001 ./server/index.js
[0] Error: spawn cmd.exe ENOENT
[0]     at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
[0]     at onErrorNT (internal/child_process.js:456:16)
[0]     at processTicksAndRejections (internal/process/task_queues.js:81:21)
[1] Error occurred when executing command: vue-cli-service build ./src/main.js --mode development --watch
[1] Error: spawn cmd.exe ENOENT
[1]     at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
[1]     at onErrorNT (internal/child_process.js:456:16)
[1]     at processTicksAndRejections (internal/process/task_queues.js:81:21)
[1] vue-cli-service build ./src/main.js --mode development --watch exited with code -4058
[0] nodemon -L --inspect=0.0.0.0:9001 ./server/index.js exited with code -4058
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! editor@0.1.0 serve: `concurrently "nodemon -L --inspect=0.0.0.0:9001 ./server/index.js" "vue-cli-service build ./src/main.js --mode development --watch"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the editor@0.1.0 serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

and my log file is this

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\node\\node.exe',
1 verbose cli   'C:\\Program Files\\node\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'serve'
1 verbose cli ]
2 info using npm@6.13.6
3 info using node@v12.14.1
4 verbose run-script [ 'preserve', 'serve', 'postserve' ]
5 info lifecycle editor@0.1.0~preserve: editor@0.1.0
6 info lifecycle editor@0.1.0~serve: editor@0.1.0
7 verbose lifecycle editor@0.1.0~serve: unsafe-perm in lifecycle true
8 verbose lifecycle editor@0.1.0~serve: PATH: C:\Program Files\node\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Jan\Desktop\projektgruppe\Main\node_modules\.bin;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\node\;C:\Program Files\Git\cmd;C:\Users\Jan\AppData\Local\Microsoft\WindowsApps;C:\Users\Jan\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Jan\AppData\Roaming\npm
9 verbose lifecycle editor@0.1.0~serve: CWD: C:\Users\Jan\Desktop\projektgruppe\Main
10 silly lifecycle editor@0.1.0~serve: Args: [
10 silly lifecycle   '/d /s /c',
10 silly lifecycle   'concurrently "nodemon -L --inspect=0.0.0.0:9001 ./server/index.js" "vue-cli-service build ./src/main.js --mode development --watch"'
10 silly lifecycle ]
11 silly lifecycle editor@0.1.0~serve: Returned: code: 1  signal: null
12 info lifecycle editor@0.1.0~serve: Failed to exec serve script
13 verbose stack Error: editor@0.1.0 serve: `concurrently "nodemon -L --inspect=0.0.0.0:9001 ./server/index.js" "vue-cli-service build ./src/main.js --mode development --watch"`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\node\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:223:5)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\node\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:223:5)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid editor@0.1.0
15 verbose cwd C:\Users\Jan\Desktop\projektgruppe\Main
16 verbose Windows_NT 10.0.18363
17 verbose argv "C:\\Program Files\\node\\node.exe" "C:\\Program Files\\node\\node_modules\\npm\\bin\\npm-cli.js" "run" "serve"
18 verbose node v12.14.1
19 verbose npm  v6.13.6
20 error code ELIFECYCLE
21 error errno 1
22 error editor@0.1.0 serve: `concurrently "nodemon -L --inspect=0.0.0.0:9001 ./server/index.js" "vue-cli-service build ./src/main.js --mode development --watch"`
22 error Exit status 1
23 error Failed at the editor@0.1.0 serve script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

It always worked, but now not. I tried many times to uninstall node modules. I reinstalled many times node, but I can not find the mistake. I have no Problem, when I just build it and start it. But that is not nice for development.

"start": "node ./server/index.js",
"serve": "concurrently \"nodemon -L --inspect=0.0.0.0:9001 ./server/index.js\" \"vue-cli-service build ./src/main.js --mode development --watch\"",
"build": "vue-cli-service build ./src/main.js",

Would be so glad for any help.

Thanks

Jan Wolfram
  • 145
  • 8
  • 2
    Try running PS as admin and running it again. Also, try adding Sys32 to path as mentioned in https://stackoverflow.com/questions/28624686/get-spawn-cmd-enoent-when-try-to-build-cordova-application-event-js85 and running your npm scripts. – sangeeth96 Jan 18 '20 at 18:59
  • 1
    `ENOENT` means file/directory not found. Did you install everything properly? – Caramiriel Jan 18 '20 at 18:59
  • Try updating vue cli version and perform an npm install ,then double check your serve script written in package.json file – BeaST 30 Jan 18 '20 at 21:01

0 Answers0