technoY2K
technoY2K

Reputation: 2570

webpack-cli init Command not found

I have webpack v4 and webpack-cli installed via npm. I am running this command...

webpack-cli init

I keep getting an Unknown command 'webpack-cli error? This is my package.json

"devDependencies": {
  "webpack": "^4.1.1",
  "webpack-cli": "^2.0.11"
}

Upvotes: 1

Views: 1974

Answers (1)

Arnold Gandarillas
Arnold Gandarillas

Reputation: 4322

You need to install webpack-cli globally in order to use it like that:

$ npm i -g webpack-cli

if you don't want to install it global you can use npx

$ npx webpack-cli init ...

npx helps to execute local packages.

Upvotes: 1

Related Questions