问答详情
源自:2-1 建立项目的 webpack 配置文件

运行配置的属性为什么会报错,那位大大帮我看看啊!


{

  "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>

求解!

提问者:慕粉1410236786 2017-03-15 19:07

个回答

  • errr
    2017-09-24 00:01:03

    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


  • VIABO
    2017-05-10 15:24:14

    呵呵,老师在这里埋了个坑,官方文档Display options中--display-reasons后面有S是复数,所以为什么以上有同学把--display-reason删了就对了...


  • 久织梦
    2017-04-30 20:02:19

    不行的都是 写错单词了- -请检查把

  • 给生活一个大大的傻笑
    2017-04-15 22:48:36

    解决了么?  我也是这个问题


  • llo蛋蛋oll
    2017-04-05 11:00:40

    --display-modules

  • 妈咪妈咪哄
    2017-03-31 00:09:40

    module打错了  应该是 --display-modules

  • 苏菲刀客
    2017-03-22 19:47:09

    C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js 去把这个文件删了试试


  • 慕粉1410236786
    2017-03-15 20:02:25

    跟下面的报错没关系

    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>


  • css魔力
    2017-03-15 19:13:14

    --display-moudles 打错了 modules