{
"name": "webpack-test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"webpack": "webpack --config webpack.config.js --progress --display-moudles --colors --display-reasons"
},
"author": "",
"license": "ISC"
}
配置好了运行:npm run webpack回车
报错如下:
Unknown argument: display-moudles
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "run" "webpack"
npm ERR! node v6.9.5
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! webpack-test@1.0.0 webpack: `webpack --config webpack.config.js --progr
ess --display-moudles --colors --display-reasons`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the webpack-test@1.0.0 webpack script 'webpack --config webpa
ck.config.js --progress --display-moudles --colors --display-reasons'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the webpack-test package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! webpack --config webpack.config.js --progress --display-moudles --c
olors --display-reasons
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs webpack-test
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls webpack-test
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to in
stall?
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Administrator.PC-20170208RKPQ\imco\webpack-test\npm-debug.
log
C:\Users\Administrator.PC-20170208RKPQ\imco\webpack-test>
求解!
npm ERR! missing script: wabpack
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2017-09-23T1
6_05_35_229Z-debug.log
呵呵,老师在这里埋了个坑,官方文档Display options中--display-reasons后面有S是复数,所以为什么以上有同学把--display-reason删了就对了...
不行的都是 写错单词了- -请检查把
解决了么? 我也是这个问题
--display-modules
module打错了 应该是 --display-modules
C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js 去把这个文件删了试试
跟下面的报错没关系
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "run" "webpack"
npm ERR! node v6.9.5
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! webpack-test@1.0.0 webpack: `webpack --config webpack.config.js --progr
ess --display-modules --colors --display-reasons`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the webpack-test@1.0.0 webpack script 'webpack --config webpa
ck.config.js --progress --display-modules --colors --display-reasons'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the webpack-test package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! webpack --config webpack.config.js --progress --display-modules --c
olors --display-reasons
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs webpack-test
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls webpack-test
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to in
stall?
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Administrator.PC-20170208RKPQ\imco\webpack-test\npm-debug.
log
C:\Users\Administrator.PC-20170208RKPQ\imco\webpack-test>
--display-moudles 打错了 modules