如何修复ReactJs中的'npm run dev'命令中同时执行命令'npm run server'和'npm run client'时发生错误

时间:2019-01-24 04:37:13

标签: node.js reactjs

我正在使用MERN Web应用程序,并尝试使用'npm run dev'命令同时运行客户端和服务器,并且出现错误。

mernshoppinglist@1.0.0 dev F:\ React \ MernShoppingList 同时“ npm运行服务器”“ npm运行客户端”

[0] Error occurred when executing command: npm run server
[0] Error: spawn cmd.exe ENOENT
[0]     at Process.ChildProcess._handle.onexit 
(internal/child_process.js:229:19)
[0]     at onErrorNT (internal/child_process.js:406:16)
[0]     at process._tickCallback 
(internal/process/next_tick.js:63:19)
[0]     at Function.Module.runMain 
(internal/modules/cjs/loader.js:746:11)
[0]     at startup (internal/bootstrap/node.js:238:19)
[0]     at bootstrapNodeJSCore (internal/bootstrap/node.js:572:3)
[1] Error occurred when executing command: npm run client
[1] Error: spawn cmd.exe ENOENT
[1]     at Process.ChildProcess._handle.onexit 
(internal/child_process.js:229:19)
[1]     at onErrorNT (internal/child_process.js:406:16)
[1]     at process._tickCallback 
(internal/process/next_tick.js:63:19)
[1]     at Function.Module.runMain 
(internal/modules/cjs/loader.js:746:11)
[1]     at startup (internal/bootstrap/node.js:238:19)
[1]     at bootstrapNodeJSCore (internal/bootstrap/node.js:572:3)
[1] npm run client exited with code -4058
[0] npm run server exited with code -4058

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mernshoppinglist@1.0.0 dev: `concurrently "npm run 
server" "npm run client"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mernshoppinglist@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely 
additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Tmp\nodejs\npm-cache\_logs\2019-01- 
24T04_08_31_288Z-debug.log

debug.log文件

0信息,如果以“ OK”结束则有效 1详细的cli ['C:\ Program Files \ nodejs \ node.exe', 1个详细的cli'C:\ Program Files \ nodejs \ node_modules \ npm \ bin \ npm-cli.js', 1个详细的cli'run', 1详细cli'dev'] 2信息使用npm@6.1.0 3信息使用node@v10.4.0 4详细的运行脚本['predev','dev','postdev'] 5信息生命周期mernshoppinglist@1.0.0~predev:mernshoppinglist@1.0.0 6个信息生命周期mernshoppinglist@1.0.0~dev:mernshoppinglist@1.0.0 7详细的生命周期mernshoppinglist@1.0.0~dev:生命周期中的unsafe-perm true 8个详细的生命周期mernshoppinglist@1.0.0~dev:路径:C:\ Program Files \ nodejs \ node_modules \ npm \ node_modules \ npm-lifecycle \ node-gyp-bin; F:\ React \ MernShoppingList \ node_modules.bin; C: \ Program Files \ Java \ jdk1.8.0_121 \ bin; C:\ Program Files \ apache-maven-3.5.3 \ bin; C:\ Program Files \ nodejs \; C:\ Program Files \ dotnet \; C:\程序文件\ Microsoft SQL Server \ 130 \ Tools \ Binn \; C:\ Users \ CHAMATH PC \ AppData \ Roaming \ npm; C:\ Program Files \ Microsoft VS Code \ bin 9详细生命周期mernshoppinglist@1.0.0~dev:CWD:F:\ React \ MernShoppingList 10个愚蠢的生命周期mernshoppinglist@1.0.0~dev:Args:['/ d / s / c','同时“ npm运行服务器”“ npm运行客户端”'] 11愚蠢的生命周期mernshoppinglist@1.0.0~dev:返回:代码:1信号:空 12信息生命周期mernshoppinglist@1.0.0~dev:无法执行开发脚本 13详细堆栈错误:mernshoppinglist@1.0.0开发人员:concurrently "npm run server" "npm run client" 13详细堆栈退出状态1 EventEmitter的13个详细堆栈。 (C:\ Program Files \ nodejs \ node_modules \ npm \ node_modules \ npm-lifecycle \ index.js:304:16) EventEmitter.emit的13个详细堆栈(events.js:182:13) ChildProcess上的13个详细堆栈。 (C:\ Program Files \ nodejs \ node_modules \ npm \ node_modules \ npm-lifecycle \ lib \ spawn.js:55:14) ChildProcess.emit的13个详细堆栈(events.js:182:13) 13个详细堆栈位于mayryClose(internal / child_process.js:961:16) Process.ChildProcess._handle.onexit上的13个详细堆栈(internal / child_process.js:248:5) 14详细的pkgid mernshoppinglist@1.0.0 15详细的cwd F:\ React \ MernShoppingList 16详细的Windows_NT 10.0.17134 17详细argv“ C:\ Program Files \ nodejs \ node.exe”“ C:\ Program Files \ nodejs \ node_modules \ npm \ bin \ npm-cli.js”“运行”“ dev” 18详细节点v10.4.0 19详细npm v6.1.0 20个错误代码ELIFECYCLE 21错误errno 1 22错误mernshoppinglist@1.0.0开发人员:concurrently "npm run server" "npm run client" 22错误退出状态1 23错误在mernshoppinglist@1.0.0开发脚本上失败。 23错误这可能不是npm的问题。上面可能还有其他日志记录输出。 24详细出口[1,true]

0 个答案:

没有答案