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
就能提示出版本号了。