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

'babel-loader' cannot be found when using npm 7.20.3+ #94

Open
Artur- opened this issue Aug 17, 2021 · 0 comments
Open

'babel-loader' cannot be found when using npm 7.20.3+ #94

Artur- opened this issue Aug 17, 2021 · 0 comments

Comments

@Artur-
Copy link

Artur- commented Aug 17, 2021

With a simple package.json: https://github.com/Artur-/webpack-babel-test/blob/main/package.json

npm install with npm 7.20.2 and earlier will install babel-loader as a top level module in node_modules
npm install with npm 7.30.2 and newer will install babel-loader as a webpack-babel-multi-target-plugin dependency in node_modules/webpack-babel-multi-target-plugin/node_modules

Because of this, a simple webpack configuration like https://github.com/Artur-/webpack-babel-test/blob/main/webpack.config.js will work fine with npm < 7.20.3 and fail with npm >= 7.20.3:

ERROR in Entry module not found: Error: Can't resolve 'babel-loader' in '/.../webpack-babel-test'

To reproduce the problem:

git clone https://github.com/Artur-/webpack-babel-test.git
cd webpack-babel-test
npx [email protected] install
node_modules/.bin/webpack

Works fine if you change the npm command to

npx [email protected] install
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