user379888
user379888

Reputation:

One CLI for webpack must be installed - Can't make webpack run

I have been trying to uninstall webpack (as it keeps giving me the text below when I run it),

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):

What have I tried?

- Installed webpack-cli
- Installed webpack-command
- $env:NODE_ENV="production" --> $env:NODE_ENV="dev" or $env:NODE_ENV="development"
- npm uninstall webpack 
- npm uninstall webpack  --save
- npm uninstall webpack  --save-dev
- npm -g uninstall webpack  --save
- npm install yarn // to see if webpack could be installed via yarn
- Installed back webpack several times
- $ npm cache clean --force at several points in between to see if cache was the issue.

What am I trying to do?

I want to build my Truffle app using webpack

Upvotes: 4

Views: 3586

Answers (3)

Toni Gallardo
Toni Gallardo

Reputation: 95

I solved it moving webpack to devDependencies

    npm install webpack --save-dev 

Upvotes: 2

Dmitriy Kashirin
Dmitriy Kashirin

Reputation: 11

Try in your terminal for new version of webpack next command: $ npx webpack

Upvotes: 0

user379888
user379888

Reputation:

After trying everything it wasn't working directly so I did it via,

npm run build

The build is calling webpack and it worked this way.

Upvotes: 3

Related Questions