我无法在任意目录中运行webpack --help
,出现以下错误:
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".
Do you want to install 'webpack-cli' (yes/no): o
You need to install 'webpack-cli' to use webpack via CLI.
You can also install the CLI manually.
我显然同时使用了npm
和yarn
。我想念什么?
答案 0 :(得分:1)
您是否已通过npm全局安装了webpack-cli?
npm install --global webpack-cli
如果是这样,可以使用命令which webpack-cli
进行验证吗?