Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm run dev 失敗 #103

Open
Malarkey-Jhu opened this issue Jul 18, 2018 · 2 comments
Open

npm run dev 失敗 #103

Malarkey-Jhu opened this issue Jul 18, 2018 · 2 comments

Comments

@Malarkey-Jhu
Copy link

Malarkey-Jhu commented Jul 18, 2018

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.

@mike1026915
Copy link

請問是不是裝新版的babel webpack之後 這些方法都無效了?

@Dulmcat
Copy link

Dulmcat commented Mar 28, 2019

教程需要更新了,按照教程安装的都会报错,这一章暂且跳过了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants