运行 npm run dev时报了错误
运行node提示:events.js:160 throw er; // Unhandled 'error' event
events.js:165
throw er; // Unhandled 'error' event
^
Error: spawn node_modules\webpack\bin\webpack.js ENOENT
at notFoundError (E:\xxx\bblog\node_modules\cross-spawn\lib\enoent.js:11:11)
at verifyENOENT (E:\xxx\bblog\node_modules\cross-spawn\lib\enoent.js:46:16)
at ChildProcess.cp.emit (E:\xxx\xxx\node_modules\cross-spawn\lib\enoent.js:33:19)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
Emitted 'error' event at:
at ChildProcess.cp.emit (E:\xxx\xxx\node_modules\cross-spawn\lib\enoent.js:36:37)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
解决:
起初以为缺少依赖,但发现npm run XXX都不灵了,于是找到了 node_modules目录,发现webpack目录被删掉了。最近一次操作时安装了vue-resource这个模块,于是乎先执行了
npm install
重新安装相关依赖,如果删掉的话要装很久不划算。
安装后发现还是有缺失的项目,但已经能启动编译了。
网友评论