webpack4.0.1安装问题和webpack.config.js的配置变化
作者:互联网
The CLI moved into a separate package: webpack-cli. Please install 'webpack-cli' in addition to webpack itself to use the CLI. -> When using npm: npm install webpack-cli -D -> When using yarn: yarn add webpack-cli -D
webpack4.0.1安装问题,提示:
The CLI moved into a separate package: webpack-cli.
Please install 'webpack-cli' in addition to webpack itself to use the CLI.
-> When using npm: npm install webpack-cli -D
-> When using yarn: yarn add webpack-cli -D
解决方案:
一、webpack -v 版本号出不来
提示:
The CLI moved into a separate package: webpack-cli.
Please install 'webpack-cli' in addition to webpack itself to use the CLI.
-> When using npm: npm install webpack-cli -D
-> When using yarn: yarn add webpack-cli -D
意思是CLI被移动到了一个专门的包 webpack-cli里了。
请安装webpack-cli 的除了webpack本身使用cli
当用npm时,使用npm install webpack-cli -D安装。
当用yarn时,使用yarn add webpack-cli -D安装。
解决办法:全局安装webpack-cli
npm install webpack-cli -g
就能提示出版本号了。
标签:npm,cli,yarn,js,webpack,install,webpack4.0,CLI 来源: https://www.cnblogs.com/xtjatswc/p/10427489.html