npm run dev 运行报错: webpack-dev-server --inline --progress --config build/webpack.dev.conf.js

澹台宾白
2023-12-01

D:\npm run dev
 
> hrsystem@1.0.0 dev D:\project_xm\hrsWeb
> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js
 
'webpack-dev-server' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! hrsystem@1.0.0 dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the hrsystem@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
 
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\deskmedia\AppData\Roaming\npm-cache\_logs\2018-09-03T06_53_35_627Z-debug.log
 

 

解决:运行如下命令,第一个和第二个参数根据自己安装的nodejs路径来填值

"C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" install --scripts-prepend-node-path=auto

 类似资料: