-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Error: Cannot find module 'webpack-cli/bin/config-yargs' #2029
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
Comments
hmm. webpack-cli changed a directory structure... But, why didn't you resolve this path? I want to know your webpkack-cli's version. |
I cannot reproduce this issue. ᐅ npm i webpack-dev-server
+ [email protected]
added 441 packages from 281 contributors and audited 3458 packages in 18.504s
found 0 vulnerabilities
ᐅ npx webpack-dev-server
Cannot find module 'webpack'
Require stack:
- /Users/Desktop/test2/node_modules/webpack-dev-server/bin/webpack-dev-server.js
ᐅ npm i webpack
npm WARN saveError ENOENT: no such file or directory
npm WARN enoent ENOENT: no such file or directory
npm WARN test2 No description
npm WARN test2 No repository field.
npm WARN test2 No README data
npm WARN test2 No license field.
+ [email protected]
added 148 packages from 130 contributors and audited 15992 packages in 10.067s
found 0 vulnerabilities
ᐅ npx webpack-dev-server
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 i -D webpack-cli
-> When using yarn: yarn add -D webpack-cli
Cannot find module 'webpack-cli/bin/config-yargs'
Require stack:
- /Users/Desktop/test2/node_modules/webpack-dev-server/bin/webpack-dev-server.js
ᐅ npm i webpack-cli
> [email protected] postinstall
> node ./bin/opencollective.js
Thanks for using webpack!
Please consider donating to our Open Collective
to help us maintain this package.
👉 Donate: https://opencollective.com/webpack/donate
npm WARN saveError ENOENT: no such file or directory
npm WARN enoent ENOENT: no such file or directory
npm WARN test2 No description
npm WARN test2 No repository field.
npm WARN test2 No README data
npm WARN test2 No license field.
+ [email protected]
added 21 packages from 21 contributors and audited 22506 packages in 5.154s
found 0 vulnerabilities
ᐅ npx webpack-dev-server
... |
You use old webpack-cli version, please update webpack-cli |
@evilebottnawi and @hiroppy I'm on the latest
|
We cannot reproduce your issue. if we need to investigate this issue, please submit the reproducible repo. |
It looks like you used |
[email protected] is OK. |
[email protected] error: Cannot find module 'yargs' |
Same problem here.
@snaill thx for investigation! |
same issue on 3.8.2 |
I ran into this issue after updating webpack-cli from:
I fixed it by changing: node_modules\webpack-dev-server\bin\webpack-dev-server.js Line 84: Line 92: |
Fixed in #1754. Upgrade to |
This is broken again when using |
Please use |
@evilebottnawi thanks for the tip. Is there any doc? Is that equivalent to |
No docs right now, webpack-cli is still in beta, docs will be improved before stable release |
No problem, I'll figure it out. But it's the new way to run dev-server, with support for HMR? |
@jods4 flags are unstable right now, please use the configuration file |
I have the same issue with the webpack-cli 4.0.0 version. Is there some way to downgrade to an older version that works or how can i solve the problem? |
Do not use |
Ok but how can I downgrade? |
What is downgrade? We don't use |
I got this, my question is how do i install an older (and working) version of webpack-cli? |
|
Already tried this. It is adding |
Something wrong with a package manager because latest is |
Thank you a lot! Unfortunately I have no idea what to look for or where the bug could be. Do you have any suggestions what to look out for? Or, if it is not to time consuming, here is a repo with the files. You would literually make my day. I try to set this thing up for hours now.... |
Just change https://github.com/Loligplayer33/Portfolio-Website-2.0/blob/master/package.json#L29 to |
can't thank you enough for your time ;) |
I wrote a python script to fix the problem until it's patched. You can just add the command to your package.json script after adding the file to your project (assuming you have python installed). |
Remove node_modules folder and if you are using yarn change to npm and run npm install otherwise remove yarn.lock |
|
I was trying to run Running |
I had windows update today that prevented recognizing |
internal/modules/cjs/loader.js:968 Error: Cannot find module 'webpack/bin/config-yargs'
npm ERR! A complete log of this run can be found in: Kindly help me with this i cant find solution from past 3 days |
Same to me:
Works:
|
@evilebottnawi wanna reopen or should I create a new issue? |
use the webpack-3.3.12 version |
This comment has been minimized.
This comment has been minimized.
Need update Old: package.json {
"scripts": {
"serve": "webpack-dev-server"
},
"devDependencies": {
"webpack-cli": "^3.3.12"
}
} New: package.json {
"scripts": {
"serve": "webpack serve"
},
"devDependencies": {
"webpack-cli": "^4.0.0"
}
} Please read my answer careful |
@evilebottnawi Your answer is somewhere in the middle of 20-30 replies to this issues. It's nowhere in the README. The version didn't change, but somehow the behaviour broke due to a release of an external lib? Dependabot has bumped cli version for quite a number of projects, so expect a lot of people flocking to this issue and potentially missing a response. The best way to solve this is just to add a line to the README: NPM package.json scripts are a convenient and useful means to run locally installed binaries without having to be concerned about their full paths. Simply define a script as such:
+ For webpack-cli 3.x:
+
"scripts": {
"start:dev": "webpack-dev-server"
}
+ For webpack-cli 4.x:
+
+ "scripts": {
+ "start:dev": "webpack serve"
+}
And run the following in your terminal/console: |
Yes, we are working on bugs in webpack-cli, it will be improved after this |
|
Hi All, having trouble with this as well.
I changed the versions to recommended ones here, but the issue persists. |
running 3.3.12 resolved this for me. |
downgraded 4.x => 3.3.12, it's work |
Operating System: Mac OS
Node Version: 10.15.1
NPM Version: 6.4.1
webpack Version: 4.34.0
webpack-dev-server Version: 3.2.1
This is a bug...?
This is a modification request
Code
Expected Behavior
Running
npm run dev:cert:webpack
starts webpack dev server.Actual Behavior
If I upgrade to webpack-dev-server 3.7.1, this error does not occur.
Thank you for your help.
The text was updated successfully, but these errors were encountered: