Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to use "npx webpack-cli init"

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?

like image 641
Martin Avatar asked Nov 29 '19 06:11

Martin


2 Answers

Try to use @webpack-cli/[email protected].
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.

like image 61
nickbullock Avatar answered Nov 10 '22 15:11

nickbullock


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

like image 29
Kim B Avatar answered Nov 10 '22 16:11

Kim B