我正在研究MERN Web应用程序并尝试使用npm run dev运行客户端和服务器,但是收到此错误 . 执行命令时出错:npm run clientError:在onErrorNT上的Process.ChildProcess._handle.onexit(internal / child_process.js:190:19)的_errnoException(util.js:1022:11)处生成cmd.exe ENOENT(内部/ child_process.js:372:16)在.combinedTickCallback(internal / process / next_tick.js:138:11)的process._tickCallback(internal / process / next_tick.js:180:9)at Function.Module.runMain(module.js) :695:11)启动时(bootstrap_node.js:188:16)bootstrap_node.js:609:3执行命令时出错:npm run clientError:spawn cmd.exe ENOENT
//package.json in server
{
"name": "mern-list",
"version": "1.0.0",
"description": "",
"main": "server.js",
"scripts": {
"client-install": "npm install --prefix client",
"start": "node server.js",
"server": "nodemon server.js",
"client": "npm start --prefix client",
"dev": "concurrently \"npm run server\" \"npm run client\""
},
"author": "",
"license": "ISC",
"dependencies": {
"body-parser": "^1.18.3",
"concurrently": "^3.6.0",
"express": "^4.16.3",
"mongoose": "^5.2.0"
},
"devDependencies": {
"nodemon": "^1.17.5"
}
}
package.json in client
{
"name": "client",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.4.1",
"react-dom": "^16.4.1",
"react-scripts": "1.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"proxy": "http://localhost:5000"
}