Webpack-cli: Error: Cannot find module 'webpack-cli'

Created on 6 May 2018  ·  16Comments  ·  Source: webpack/webpack-cli

we

needs investigation question

Most helpful comment

installing webpack-cli globally solved it for me
npm i -g webpack-cli

All 16 comments

Could you install it globally?

Yeah it's worked .. thank you ..
But appeared a new error when i try to bundle js file.

33

Did you install it locally or globally? Try webpack script.1 --o bundle.js

Yeah it worked .. thank you ..

Did you install the cli locally?

same problem using 3.0.0 cant find solution here!
didnt worked for me

Try upgrading to webpack-cli v.3.0.2 and above

installing webpack-cli globally solved it for me
npm i -g webpack-cli

The error was due to you installing webpack globally and trying to install the webpack-cli locally. I face the same problem.

npm rm -g webpack-cli
And in the project
npm i -D webpack-cli

That did it for me

may be the solution of this problem is below

I also got this problem....
Capture

it should be in sequence in package.json
Capture

webpack 4.41.5
webpack-cli 3.0.2
npx webpack hello.js --output-filename hello.bundle.js --output-path . --mode development
It's ok

npm install [email protected] --save-dev

npm uninstall -g webpack-cli
then
npm i webpack-cli

That did it for me

installing webpack-cli globally solved it for me
npm i -g webpack-cli

全球安装webpack-cli为我解决了
npm i -g webpack-cli

我查了半天,按照你这个解决了

Was this page helpful?
0 / 5 - 0 ratings