解决: 运行npm run webpack命令报错问题

解决: 运行npm run webpack报错

问题描述:

MacBook-Pro:webpack-demo $ npm run-script webpack
[email protected] webpack /Users/aaaaaaa/webpack/webpack-demo
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
npm ERR! Darwin 17.2.0
npm ERR! argv “/usr/local/bin/node” “/usr/local/bin/npm” “run-script” “webpack”
npm ERR! node v6.11.4
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] webpack: webpack
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] webpack script ‘webpack’.
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-demo package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! webpack
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs webpack-demo
npm ERR! Or if that isn’t available, you can get their info via:
npm ERR! npm owner ls webpack-demo
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/aaa/webpack/webpack-demo/npm-debug.log

解决方法: webpack 替换为 webpack-cli 问题解决
解决: 运行npm run webpack命令报错问题_第1张图片

你可能感兴趣的:(Web前端)