我正在Windows上运行一个新的laravel项目,到目前为止一切正常,但是当我尝试运行此命令时,我遇到了这些错误:
C:\ Users *** \ Documents \ files \ Laravel \ RSWebSite> npm run dev
'CALL“ C:\ Program Files \ nodejs \ node.exe”“ C:\ Program Files \ nodejs \ node_modules \ npm \ bin \ npm-cli.js“前缀-g'n'est pas 外部编程专家 可执行命令。
> @ dev C:\Users\***\Documents\files\Laravel\RSWebSite > npm run development npm ERR! code ELIFECYCLE npm ERR! syscall spawn C:\windows\system32\cmd.exe; npm ERR! file C:\windows\system32\cmd.exe; npm ERR! path C:\windows\system32\cmd.exe; npm ERR! errno ENOENT npm ERR! @ dev: `npm run development` npm ERR! spawn C:\windows\system32\cmd.exe; ENOENT npm ERR! npm ERR! Failed at the @ 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:\Users\***\AppData\Roaming\npm-cache\_logs\2019-10-22T14_06_36_677Z-debug.log
这是我的package.json文件:
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "npm run development -- --watch",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"axios": "^0.19",
"bootstrap": "^4.0.0",
"cross-env": "^5.1",
"jquery": "^3.2",
"laravel-mix": "^4.0.7",
"lodash": "^4.17.13",
"popper.js": "^1.12",
"resolve-url-loader": "^2.3.1",
"sass": "^1.20.1",
"sass-loader": "7.*",
"vue": "^2.5.17",
"vue-template-compiler": "^2.6.10"
}
}
答案 0 :(得分:0)
在大多数时候,我遇到一个新项目。
尝试这样做。
npm install
npm audit fix
然后有时再次运行它,原因是缺少包。