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 npm@7.20.3 install
node_modules/.bin/webpack
Works fine if you change the npm command to
With a simple package.json: https://github.com/Artur-/webpack-babel-test/blob/main/package.json
npm installwith npm 7.20.2 and earlier will installbabel-loaderas a top level module innode_modulesnpm installwith npm 7.30.2 and newer will installbabel-loaderas a webpack-babel-multi-target-plugin dependency innode_modules/webpack-babel-multi-target-plugin/node_modulesBecause 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:
To reproduce the problem:
Works fine if you change the npm command to