我正在尝试测试自定义 Webpack 配置。我已经读过,而不是打字node ./node_modules/webpack/bin/webpack.js
,我可以使用npx webpack
. 但我似乎无法让它工作。
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
当我切换到 running 时npx webpack-cli
,我得到一个不同的错误:
user@comp:~/> npx webpack-cli
npx: installed 489 in 19.186s
Cannot find module 'webpack'