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

Error: Cannot find module 'webpack-cli/bin/config-yargs' #63

Closed
pokvoja opened this issue Nov 11, 2019 · 9 comments · Fixed by #68
Closed

Error: Cannot find module 'webpack-cli/bin/config-yargs' #63

pokvoja opened this issue Nov 11, 2019 · 9 comments · Fixed by #68
Labels
help wanted Open to participation from the community

Comments

@pokvoja
Copy link

pokvoja commented Nov 11, 2019

Describe the bug
When trying to build by running npm run dev the webpack server fails with the following error:

$ npm run dev

> cc-chooser@1.0.0 dev /home/user/projects/cc-chooser
> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js

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

Error: Cannot find module 'webpack-cli/bin/config-yargs'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:587:15)
    at Function.Module._load (internal/modules/cjs/loader.js:513:25)
    at Module.require (internal/modules/cjs/loader.js:643:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/home/user/projects/cc-chooser/node_modules/webpack-dev-server/bin/webpack-dev-server.js:84:1)
    at Module._compile (internal/modules/cjs/loader.js:707:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:718:10)
    at Module.load (internal/modules/cjs/loader.js:605:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:544:12)
    at Function.Module._load (internal/modules/cjs/loader.js:536:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cc-chooser@1.0.0 dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the cc-chooser@1.0.0 dev 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!     /home/user/.npm/_logs/2019-11-11T18_03_07_465Z-debug.log

To Reproduce
Steps to reproduce the behavior:

  1. clone the repo
  2. run npm i
  3. run npm run dev

Expected behavior
It should build and run a server with the buld

Desktop (please complete the following information):

@pokvoja
Copy link
Author

pokvoja commented Nov 11, 2019

might be related to:
webpack/webpack-dev-server#2029

@akmadian
Copy link
Member

Hey @pokvoja, please provide the npm log that was generated. A pastebin link or something similar to that would be best :)

@pokvoja
Copy link
Author

pokvoja commented Nov 11, 2019

sorry if forgot about that!

its small enough for gitlab:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'dev' ]
2 info using npm@6.12.0
3 info using node@v12.13.0
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle cc-chooser@1.0.0~predev: cc-chooser@1.0.0
6 info lifecycle cc-chooser@1.0.0~dev: cc-chooser@1.0.0
7 verbose lifecycle cc-chooser@1.0.0~dev: unsafe-perm in lifecycle true
8 verbose lifecycle cc-chooser@1.0.0~dev: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/user/projects/cc-chooser/node_modules/.bin:/home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
9 verbose lifecycle cc-chooser@1.0.0~dev: CWD: /home/user/projects/cc-chooser
10 silly lifecycle cc-chooser@1.0.0~dev: Args: [
10 silly lifecycle   '-c',
10 silly lifecycle   'webpack-dev-server --inline --progress --config build/webpack.dev.conf.js'
10 silly lifecycle ]
11 silly lifecycle cc-chooser@1.0.0~dev: Returned: code: 1  signal: null
12 info lifecycle cc-chooser@1.0.0~dev: Failed to exec dev script
13 verbose stack Error: cc-chooser@1.0.0 dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:210:5)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:210:5)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid cc-chooser@1.0.0
15 verbose cwd /home/user/projects/cc-chooser
16 verbose Linux 4.15.0-58-generic
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dev"
18 verbose node v12.13.0
19 verbose npm  v6.12.0
20 error code ELIFECYCLE
21 error errno 1
22 error cc-chooser@1.0.0 dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`
22 error Exit status 1
23 error Failed at the cc-chooser@1.0.0 dev script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

@akmadian
Copy link
Member

Try updating all webpack related packages to their latest versions and try again? Particularly webpack, and webpack-dev-server

@akmadian
Copy link
Member

@pokvoja I'm assuming since you've opened a PR, you fixed this issue? If so, what was the solution?

@onyijne
Copy link
Contributor

onyijne commented Nov 24, 2019

Getting the same error, and it appears to be deprecated issues.
Would it be out of place if I suggest we migrate cc-chooser to a vue-cli project?

@obulat
Copy link
Contributor

obulat commented Dec 14, 2019

I can reproduce this issue, and unfortunately, after trying to solve it (by updating everything related to webpack and trying other possible steps) I had to go back to commit 48bd00b.
I've also read that sometimes the problem shows up on Linux and Windows machines, but not on MacOS.

@akmadian akmadian added bug help wanted Open to participation from the community labels Dec 15, 2019
@akmadian
Copy link
Member

Could not reproduce.

  • OS: Windows 10 Pro 1809 17763.914 64 bit
  • Node: v10.15.3
  • npm: v6.4.1

@obulat please post your os, node, and npm info in this thread. Let's narrow it down :) not sure if this will be relevant once we transition to vue3-cli, though.

@obulat
Copy link
Contributor

obulat commented Dec 20, 2019

My details are:

  • OS: Windows 10 Home edition 1903 18362.535 64 bit
  • node: v13.3.0
  • npm: v. 6.4.1

Is it because of the Node version? It might also be due to the global Webpack version, but I've already uninstalled it

@obulat obulat mentioned this issue Dec 20, 2019
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Open to participation from the community
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants