0

node开发环境启动异常,mac能正常启动,迁移到windows下面报错

控制台输出

Error: spawn cmd ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
    at Function.Module.runMain (internal/modules/cjs/loader.js:757:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
Emitted 'error' event at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
    at onErrorNT (internal/child_process.js:415:16)
    [... lines matching original stack trace ...]
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
error Command failed with exit code 1.

错误日志

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'start:dev' ]
2 info using npm@6.4.1
3 info using node@v10.15.3
4 verbose run-script [ 'prestart:dev', 'start:dev', 'poststart:dev' ]
5 info lifecycle betadata-analytics-frontend@1.0.0~prestart:dev: betadata-analytics-frontend@1.0.0
6 info lifecycle betadata-analytics-frontend@1.0.0~start:dev: betadata-analytics-frontend@1.0.0
7 verbose lifecycle betadata-analytics-frontend@1.0.0~start:dev: unsafe-perm in lifecycle true
8 verbose lifecycle betadata-analytics-frontend@1.0.0~start:dev: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\com\analytics-frontend\node_modules\.bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\辰小羽\bin;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files\MySQL\MySQL Server 5.7\bin;C:\Program Files (x86)\MySQL\MySQL Server 5.7\bin;C:\Program Files\TortoiseSVN\bin;C:\WINDOWS\System32\OpenSSH;C:\Program Files\nodejs;E:\node\global;C:\Users\辰小羽\Desktop\app;C:\Program Files\Git\cmd;D:\maven\bin;D:\devoloment tools\java\jdk1.8.0_161\bin;D:\Program Files\Scripts;D:\Program Files;C:\Users\辰小羽\AppData\Local\Microsoft\WindowsApps;C:\Users\辰小羽\AppData\Roaming\npm;C:\Users\辰小羽\AppData\Local\Programs\Microsoft VS Code\bin
9 verbose lifecycle betadata-analytics-frontend@1.0.0~start:dev: CWD: D:\com\analytics-frontend
10 silly lifecycle betadata-analytics-frontend@1.0.0~start:dev: Args: [ '/d /s /c', 'better-npm-run start:dev' ]
11 silly lifecycle betadata-analytics-frontend@1.0.0~start:dev: Returned: code: 1  signal: null
12 info lifecycle betadata-analytics-frontend@1.0.0~start:dev: Failed to exec start:dev script
13 verbose stack Error: betadata-analytics-frontend@1.0.0 start:dev: `better-npm-run start:dev`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:189:13)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:189:13)
13 verbose stack     at maybeClose (internal/child_process.js:970:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid betadata-analytics-frontend@1.0.0
15 verbose cwd D:\com\analytics-frontend
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "start:dev"
18 verbose node v10.15.3
19 verbose npm  v6.4.1
20 error code ELIFECYCLE
21 error errno 1
22 error betadata-analytics-frontend@1.0.0 start:dev: `better-npm-run start:dev`
22 error Exit status 1
23 error Failed at the betadata-analytics-frontend@1.0.0 start:dev script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

问题出现的环境背景及自己尝试过哪些方法

相关代码

// 请把代码文本粘贴到下方(请勿用图片代替代码)

你期待的结果是什么?实际看到的错误信息又是什么?

_jfiy 4
2019-05-15 提问

查看全部 2 个回答

0

已采纳

你这个问题一百度就有了,https://www.imooc.com/qadetai...,看看是不是环境变量的问题。

推广链接