安装了webpack 运行webpack 报错One CLI for webpack must be installed. These are recommended choices, delive

安装了webpack报错

One CLI for webpack must be installed. These are recommended choices, delivered as separate packages:
 - webpack-cli (https://github.com/webpack/webpack-cli)
   The original webpack full-featured CLI.
We will use "npm" to install the CLI via "npm install -D".

解决方案

先全局安装webpack和webpack-cli

sudo npm install webpack -g
输入你的密码。。。 这个就不用多说了。。。

  • 然后

sudo npm install webpack-cli -g

再局部安装webpack和webpack-cli

sudo npm install webpack --save-dev

. 然后

sudo npm install webpack-cli --save-dev

OK 搞定

你可能感兴趣的:(webpack)