Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

webpack -v endlessly states that one CLI for webpack must be installed

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.

like image 830
SomeDevTesting123 Avatar asked Jun 05 '18 21:06

SomeDevTesting123


People also ask

What CLI do I need to install Webpack?

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

What does [Webpack-CLI] TypeError [foreach] mean?

[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.

Should I install Webpack locally or via NPM?

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:

How do I get help from the Webpack command line?

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:


1 Answers

Try npm install webpack-cli -g

like image 91
Unantsika Avatar answered Sep 21 '22 07:09

Unantsika