You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
yarn run v1.22.22
$ cross-env NODE_ENV=development yarn _webpack
$ npx --node-options='--max_old_space_size=8192' webpack
node:internal/modules/cjs/loader:1146
throw err;
^
Error: Cannot find module 'C:\Users\User\wireframe-tool\node_modules\node_modules\webpack\bin\webpack.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
at Module._load (node:internal/modules/cjs/loader:984:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v20.12.2
Expected Behavior
It should obviously be looking for webpack.js at C:\Users\User\wireframe-tool\node_modules\webpack\bin\webpack.js
Steps To Reproduce
In Windows, powershell/git bash doesn't matter
With yarn 1.x workspaces with a webpack 5 workspace (not the root of course)
Run yarn workspace @foo/bar run
Environment
npm: 10.5.0
Node.js: v20.12.2
OS Name: Windows 11
System Model Name:
npm config:
; "builtin" config from C:\Program Files\nodejs\node_modules\npm\npmrcprefix = "C:\\Users\\User\\AppData\\Roaming\\npm"; node bin location = C:\Program Files\nodejs\node.exe; node version = v20.12.2; npm local prefix = C:\Users\User\wireframe-tool; npm version = 10.5.0; cwd = C:\Users\User\wireframe-tool; HOME = C:\Users\User; Run `npm config ls -l` to show all defaults.
The text was updated successfully, but these errors were encountered:
charlesritchea
changed the title
[BUG] Windows npx webpack looking in node_modules/node_modules/webpack
[BUG] Windows npx looking in node_modules/node_modules
May 3, 2024
Very strange. I get the same error if I swap out webpack for ng, but it is able to resolve jest. I also tried multiple npm versions including 9.x and it reproduces in all of them, so I don't think it's a regression on the npm side. No idea what suddenly caused this change.
This is the ecosystem at the whims of the latest Chrome version, i.e. if
something changed on the platform that box is running on, so that it can't
tell which folder is workspace root and which is node_modules then that's a
support issue whether it's a "bug" or not. Feel free to close it if you
want, but can you at least steer me in the direction of debugging this?
We're going to have to replace npx in all of our scripts because it doesn't
work for some mystical reason on Windows
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Expected Behavior
It should obviously be looking for webpack.js at C:\Users\User\wireframe-tool\node_modules\webpack\bin\webpack.js
Steps To Reproduce
Environment
The text was updated successfully, but these errors were encountered: