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

webpack-cli 4.x 's error in the lesson #188

Open
mox692 opened this issue Nov 26, 2020 · 0 comments
Open

webpack-cli 4.x 's error in the lesson #188

mox692 opened this issue Nov 26, 2020 · 0 comments

Comments

@mox692
Copy link

mox692 commented Nov 26, 2020

Hi 👋, I succeeded this lesson.

But when I run $ npm start, this error occurred.

$ npm start

> [email protected] start /Users/kimuramotoyuki/react/react-typescript-samples/handson/00
> webpack-dev-server  --mode development --inline --hot --open

internal/modules/cjs/loader.js:1033
  throw err;
  ^

Error: Cannot find module 'webpack-cli/bin/config-yargs'
Require stack:
- /Users/kimuramotoyuki/react/react-typescript-samples/handson/00/node_modules/webpack-dev-server/bin/webpack-dev-server.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1030:15)
    at Function.Module._load (internal/modules/cjs/loader.js:899:27)
    at Module.require (internal/modules/cjs/loader.js:1090:19)
    at require (internal/modules/cjs/helpers.js:75:18)
    at Object.<anonymous> (/Users/kimuramotoyuki/react/react-typescript-samples/handson/00/node_modules/webpack-dev-server/bin/webpack-dev-server.js:65:1)
    at Module._compile (internal/modules/cjs/loader.js:1201:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1221:10)
    at Module.load (internal/modules/cjs/loader.js:1050:32)
    at Function.Module._load (internal/modules/cjs/loader.js:938:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/kimuramotoyuki/react/react-typescript-samples/handson/00/node_modules/webpack-dev-server/bin/webpack-dev-server.js'
  ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `webpack-dev-server  --mode development --inline --hot --open`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/kimuramotoyuki/.npm/_logs/2020-11-26T07_28_39_960Z-debug.log

This issue smells similar err, caused by webpack-cli 4.x

So I think it is good way to fix the webpack-cli's version under 4.x in this lesson.

$ npm install [email protected] --save-dev

@mox692 mox692 changed the title webpack-cli 4.x can't webpack-cli 4.x can Nov 26, 2020
@mox692 mox692 changed the title webpack-cli 4.x can webpack-cli 4.x 's error in the lesson Nov 26, 2020
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

1 participant