执行npm run dev的时候报如下错误
> dev
> npm run development
> development
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.c onfig.js
????????????·????
node:events:498
throw er; // Unhandled 'error' event
^
Error: spawn node_modules\webpack\bin\webpack.js ENOENT
at notFoundError (E:\code\laraveladmin\node_modules\_cross-spawn@7.0.3@cross-spawn\lib\enoent.js:6:26)
at verifyENOENT (E:\code\laraveladmin\node_modules\_cross-spawn@7.0.3@cross-spawn\lib\enoent.js:40:16)
at ChildProcess.cp.emit (E:\code\laraveladmin\node_modules\_cross-spawn@7.0.3@cross-spawn\lib\enoent.js:27:25)
at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess.cp.emit (E:\code\laraveladmin\node_modules\_cross-spawn@7.0.3@cross-spawn\lib\enoent.js:30:37)
at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) {
code: 'ENOENT',
errno: 'ENOENT',
syscall: 'spawn node_modules\\webpack\\bin\\webpack.js',
path: 'node_modules\\webpack\\bin\\webpack.js',
spawnargs: [
'--progress',
'--config=node_modules/laravel-mix/setup/webpack.config.js'
]
}
解决方法是安装webpack:
npm install webpack
?再执行npm run dev就可以了
|