3
votes

When I try running npm run build for a new webpack build I get

You have installed webpack-cli and webpack-command together. To work with the "webpack" command you need only one CLI package, please remove one of them or use them directly via their binary.

I think I installed them globally. I tried, deleting them, webpack, deleating node clearing cache but I keep getting the same result.

Using webpack 4

{
"name": "ls",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
  "build": "webpack"
 },
 "author": "",
 "license": "ISC",
 "devDependencies": {
 "webpack": "^4.16.5",
 "webpack-cli": "^3.1.0"
 }
}
1
Can you post your package.json?Alex Mulchinock
done @AlexMulchinockronoc4
Are you sure you deleted the package from global package directory of npmAnuragh KP
Remove webpack-cli from package.json run npm install and try again.Armin Ayari
You could also remove webpack-command globally if you want. npm uninstall -g webpack-commanderPlayMa256

1 Answers

1
votes

I think the message was quite clear so just run npm uninstall "webpack-command" to remove webpack-command (b/c "webpack-cli" has newer version)