-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Error: Cannot find module 'webpack-cli/bin/config-yargs' when use v5 #2424
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
Yes, please use |
Oh, should be work, can you open issue in webpack-cli? |
OK,I will. |
Same problem here -- any update since Feb 3?
|
Same problem for me
What does works? |
Try |
"devDependencies": {
"@webpack-cli/serve": "1.0.1-alpha.5",
"webpack": "5.0.0-beta.26",
"webpack-cli": "4.0.0-beta.8",
"webpack-dev-server": "^3.11.0"
},
|
@koistya do you use yarn? |
@evilebottnawi That specific issue was fixed in webpack/webpack-cli#1376 5 months ago, but it hasn't been released yet. And yes, that's a Yarn PnP error message |
@merceyz release |
Any updates on this? "@webpack-cli/serve": "^0.2.0",
"webpack": "^5.0.0-beta.29",
"webpack-cli": "^4.0.0-beta.8",
"webpack-dev-server": "^3.11.0"
[webpack-cli] The command moved into a separate package: @webpack-cli/serve
? Would you like to install @webpack-cli/serve? (That will run npm install -D @webpack-cli/serve) (Y/n) › true |
@bahtou You need to install the beta version of |
"@webpack-cli/serve": "^1.0.1-alpha.5",
"webpack": "^5.0.0-beta.29",
"webpack-cli": "^4.0.0-beta.8",
"webpack-dev-server": "^3.11.0",
Module not found: Error: Can't resolve './index.js' If I move |
@bahtou fixed in webpack-cli, release will be today/tomorrow, feel free to feedback after new release |
any update on this. |
This comment has been minimized.
This comment has been minimized.
@NicholasBoll What do you mean? |
This comment has been minimized.
This comment has been minimized.
@NikoGrano How you run webpack-dev-server? |
This comment has been minimized.
This comment has been minimized.
You need to use |
@evilebottnawi Just reporting results: It works! Thank you! |
@evilebottnawi thank you. This really needs to be mentioned in the migrate to webpack 5 doc that is out there |
@evilebottnawi I'm getting this error when I updated: "@webpack-cli/serve": "^1.0.1-rc.0",
"webpack": "^5.0.0-rc.0",
"webpack-cli": "^4.0.0-rc.0",
"webpack-dev-server": "^3.11.0", > webpack server --config .webpack/index.js --mode development
[webpack-cli] TypeError: Cannot read property 'length' of undefined Is there a way to get a more verbose output? I am not using |
I don't know if you are the same team that maintains webpack-dev-server but wouldn't be cool if there is a post or article exposing this change? From my point of view this is some kind of breaking change... Don't you agree? Maybe a commentary on the changelog should be enough. |
this is totally frustrating :( tried all suggestions/hacks from all opened issues, but nothing works..
am i missing something? please, help! |
Please use |
@evilebottnawi I think the issue is we do not get the same functionality with just using |
i was trying to run it from cli/console, which still don't work btw; yes, if i run it as package.json script (npm run-script ...) than it's ok; thanks! |
This comment has been minimized.
This comment has been minimized.
@evilebottnawi is this a temporary solution and if not could you give me an example of how to live-reload on change with the webpack serve |
Hello 👋.
done! |
This seems like a lot of hoops to jump through compared to just doing |
using works on windows (node 14),
works on ubuntu after downgrade to: |
perfect |
Fixed in |
Could someone explain what "webpack serve" is actually doing as a command, as opposed to "webpack-dev-server"? It might help people understand why they now have to do this. Is it running the "webpack-serve" server instead of the "webpack-dev-server" one? (if so, how does it work without that dependency being installed?) I found plenty of reports saying webpack-dev-server is only in maintenance and that people should use webpack-serve instead, but that doesn't seem to be the case here as web-pack-dev server now appears to have a major new version in beta? This is all quite confusing for people I think! :( |
It didn't work for me until I specified the 'contentBase' and 'port' property of the devServer and ran the command 'webpack serve --config ./webpack.config.js' |
(except for webpack-cli, which is 3.3.11 to resolve webpack/webpack-dev-server#2424)
Following suggestions from thread on github: webpack/webpack-dev-server#2424
webpack-cli@4 requires webpack-dev-server@4: https://github.com/webpack/webpack-dev-server/releases/tag/v4.0.0-beta.0 * Migrate config from v3 to v4: https://github.com/webpack/webpack-dev-server/blob/master/migration-v4.md * Invoke webpack-dev-server using `webpack serve` instead: "Error: Cannot find module 'webpack-cli/bin/config-yargs' when use v5" webpack/webpack-dev-server#2424 * Pass production/development env with `--node-env` instead: https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md#450-2021-02-02
webpack-cli@4 requires webpack-dev-server@4: https://github.com/webpack/webpack-dev-server/releases/tag/v4.0.0-beta.0 * Migrate config from v3 to v4: https://github.com/webpack/webpack-dev-server/blob/master/migration-v4.md * Invoke webpack-dev-server using `webpack serve` instead: "Error: Cannot find module 'webpack-cli/bin/config-yargs' when use v5" webpack/webpack-dev-server#2424 * Pass production/development env with `--node-env` instead: https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md#450-2021-02-02
webpack-cli@4 requires webpack-dev-server@4: https://github.com/webpack/webpack-dev-server/releases/tag/v4.0.0-beta.0 * Migrate config from v3 to v4: https://github.com/webpack/webpack-dev-server/blob/master/migration-v4.md * Invoke webpack-dev-server using `webpack serve` instead: "Error: Cannot find module 'webpack-cli/bin/config-yargs' when use v5" webpack/webpack-dev-server#2424 * Pass production/development env with `--node-env` or nothing instead: https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md#450-2021-02-02 * `cross-env` is no longer needed * Webpack sets production/development env to 'production' by default https://v4.webpack.js.org/configuration/mode/
webpack-cli@4 requires webpack-dev-server@4: https://github.com/webpack/webpack-dev-server/releases/tag/v4.0.0-beta.0 * Migrate config from v3 to v4: https://github.com/webpack/webpack-dev-server/blob/master/migration-v4.md * Invoke webpack-dev-server using `webpack serve` instead: "Error: Cannot find module 'webpack-cli/bin/config-yargs' when use v5" webpack/webpack-dev-server#2424 * Pass production/development env with `--node-env` or nothing instead: https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md#450-2021-02-02 * `cross-env` is no longer needed * Webpack sets production/development env to 'production' by default https://v4.webpack.js.org/configuration/mode/
webpack-cli@4 requires webpack-dev-server@4: https://github.com/webpack/webpack-dev-server/releases/tag/v4.0.0-beta.0 * Migrate config from v3 to v4: https://github.com/webpack/webpack-dev-server/blob/master/migration-v4.md * Invoke webpack-dev-server using `webpack serve` instead: "Error: Cannot find module 'webpack-cli/bin/config-yargs' when use v5" webpack/webpack-dev-server#2424 * Pass production/development env with `--node-env` or nothing instead: https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md#450-2021-02-02 * `cross-env` is no longer needed * Webpack sets production/development env to 'production' by default https://v4.webpack.js.org/configuration/mode/
…ig-yargs' Can't run make watch-admin in Dockware as it stops with the following error: Error: Cannot find module 'webpack-cli/bin/config-yargs' Require stack: - /var/www/html/vendor/shopware/administration/Resources/app/administration/node_modules/webpack-dev-server/bin/webpack-dev-server.js at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15) at Function.Module._load (node:internal/modules/cjs/loader:778:27) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object.<anonymous> (/var/www/html/vendor/shopware/administration/Resources/app/administration/node_modules/webpack-dev-server/bin/webpack-dev-server.js:65:1) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) { code: 'MODULE_NOT_FOUND', requireStack: [ '/var/www/html/vendor/shopware/administration/Resources/app/administration/node_modules/webpack-dev-server/bin/webpack-dev-server.js' ] } makefile:65: recipe for target 'watch-admin' failed make: *** [watch-admin] Error 1 Fixes Error: Cannot find module 'webpack-cli/bin/config-yargs' If you're using webpack 4 you should use "webpack serve" instead of "webpack-dev-server": https://stackoverflow.com/questions/64803892/error-error-cannot-find-module-webpack-cli-bin-config-yargs-require-stack webpack/webpack-dev-server#2424
webpack-dev-server/bin/webpack-dev-server.js
Line 61 in c9e9178
webpack-cli/bin/
no longer exists as of (webpack/webpack-cli@82407e5). This is a blocker for at leastwebpack-cli@4.0.0-alpha-5
. Is there a workaround...?Originally posted by @JoshuaKGoldberg in #2239 (comment)
The text was updated successfully, but these errors were encountered: