webpack 安装后 运行提示安装webpack-cli

都在全局安装(安装在同一目录)

npm install webpack -g (个人项目里,npm install --save-dev webpack -g)

输入以上命令后: webpack -v 提示:

The CLI moved into a separate package: webpack-cli
Would you like to install webpack-cli? (That will run npm install -D webpack-cli) (yes/NO)NO
It needs to be installed alongside webpack to use the CLI

这里提示安装 webpack-cli// 是因为到了webpack4, webpack 已经将 webpack 命令行相关的内容都迁移到 webpack-cli,所以除了 webpack 外,我们还需要安装 webpack-cli:

npm install webpack-cli -g (个人项目里,npm install --save-dev webpack-cli -g)

你可能感兴趣的:(webpack)