8
mkdir demo & cd demo
npm init -y
npm i --save-dev webpack webpack-cli
npm i webpack-cli @webpack-cli/init
npx webpack-cli init

but when run

npx webpack-cli init

i get the error

init isn't a valid name.

It should be prefixed with 'webpack-scaffold', but have different suffix.

How can I solve it?

Martin
  • 121
  • 2
  • 10

2 Answers2

8

Try to use @webpack-cli/init@0.2.2.
There are some problems with 0.3 https://github.com/webpack/webpack-cli/issues/1127
Also in webpack-cli@beta (v4), they renamed init to create.

nickbullock
  • 6,424
  • 9
  • 27
1

use npx webpack-cli create instead npx webpack-cli init

Kim B
  • 61
  • 1
  • 6