简体   繁体   中英

why does webpack gives error when run npm run dev

I'm trying to run "npm run dev" in my laravel project but there is an error occured that saying: Error: Cannot find module 'webpack-cli/package.json' Require stack:

  • C:\Users\abdal\AppData\Roaming\npm-cache_npx\20792\node_modules\webpack\bin\webpack.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15) at Function.resolve (internal/modules/cjs/helpers.js:78:19) at runCli (C:\Users\abdal\AppData\Roaming\npm-cache_npx\20792\node_modules\webpack\bin\webpack.js:50:26) at C:\Users\abdal\AppData\Roaming\npm-cache_npx\20792\node_modules\webpack\bin\webpack.js:139:5 at processTicksAndRejections (internal/process/task_queues.js:97:5) { code: 'MODULE_NOT_FOUND', requireStack: [ 'C:\Users\abdal\AppData\Roaming\npm-cache\_npx\20792\node_modules\webpack\bin\webpack.js' ] }

Note that the webpack cli has been downloaded.

Try running the following.

npm install -g webpack-cli

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM