I'm trying to test a custom Webpack configuration. I've read that instead of typing node ./node_modules/webpack/bin/webpack.js
, I can use npx webpack
. But I can't seem to get it to work.
user@comp:~/raw> npx webpack
The CLI moved into a separate package: webpack-cli.
Please install 'webpack-cli' in addition to webpack itself to use the CLI.
-> When using npm: npm install webpack-cli -D
-> When using yarn: yarn add webpack-cli -D
When I switch to running npx webpack-cli
, I get a different error:
user@comp:~/> npx webpack-cli
npx: installed 489 in 19.186s
Cannot find module 'webpack'
Please install 'webpack-cli' in addition to webpack itself to use the CLI.
-> When using npm: npm install webpack-cli -D
-> When using yarn: yarn add webpack-cli -D
Basically that's all. After you've installed the webpack-cli just use
npx webpack
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With