用webpack 打包项目的时候:webpack js.js bundle.js 报错.
最近在安装好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.
- webpack-command (https://github.com/webpack-contrib/webpack-command)
A lightweight, opinionated webpack CLI.
We will use “npm” to install the CLI via “npm install -D”.
Which one do you like to install (webpack-cli/webpack-command):
我在2018年3月28日的文章“https://blog.csdn.net/jiang7701037/article/details/79403637#commentsedit”也提到了,需要全局安装webpack-cli。虽然这次提示变了,解决方案依然是需要全局安装webpack-cli
如下:
npm install webpack-cli -g
在项目里再做一个本地安装:
npm install webpack -D
转: https://blog.csdn.net/jiang7701037/article/details/80681310