-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
scripts 中已經添加這行:
"dev": "webpack-dev-server --devtool eval --progress --colors --content-base build",
但terminal還是顯示錯誤,好像是要叫我裝webpack
但按照他給我的提示npm install webpack-cli -D
之後還是出錯
以下是報錯信息,有人知道怎麼解決嗎
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
module.js:549
throw err;
^
Error: Cannot find module 'webpack-cli/bin/config-yargs'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object. (/Users/alan_pc/Desktop/ReactTraining/reactjs-101/node_modules/webpack-dev-server/bin/webpack-dev-server.js:65:1)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! reactjs-101@1.0.0 dev: webpack-dev-server --devtool eval --progress --colors --content-base build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the reactjs-101@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.