I have npm version 5.60 installed.
In my package.json I have the following two devDependencies:
"webpack": "~1.12.15",
"webpack-cli": "^3.0.2"
Whenever I enter either webpack
or webpack -v
in the command line, I always receive the same response:
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):
I have entered webpack-cli
here and I have also installed it via npm install --save-dev webpack-cli
I have also tried adding the webpack task runner to visual studio. My solution already has an existing webpack.config.js file. When I select it, I get the blue icon indicating that it utilizes the webpack task runner, but nothing ever appears within the task runner. I think this is just a symptom of webpack not being properly installed, however.
I am using VS 2017 in Windows 10 64.
Any help appreciated.
One CLI for webpack must be installed. These are recommended choices, delivered as separate packages #109 One CLI for webpack must be installed. These are recommended choices, delivered as separate packages #109
[webpack-cli] TypeError: options.forEach is not a function Read the report incorrectly, which means that “ [webpack cli] cannot load the” @ webpack cli/serve “command”. I think it should be installed if the webpack cli cannot be loaded.
Installing locally is what we recommend for most projects. This makes it easier to upgrade projects individually when breaking changes are introduced. Typically webpack is run via one or more npm scripts which will look for a webpack installation in your local node_modules directory:
Both webpack help [command] [option] and webpack [command] --help are valid to get help: To inspect the version of webpack and webpack-cli you are using, run the command: This will output the following result: It will output the version of webpack-dev-server as well if you have it installed:
Try npm install webpack-cli -g
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With