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

Second install fails if install with pnpm and node-linker=hoisted #142

Open
DzmVasileusky opened this issue Jun 22, 2023 · 3 comments
Open

Comments

@DzmVasileusky
Copy link

DzmVasileusky commented Jun 22, 2023

parcel version:
2.0.4

pnpm version:
8.5.1

Code to reproduce the issue:
Clone this repo https://github.com/DzmVasileusky/pnpm-issue-1
run pnpm i
run pnpm i again
Expected behavior:
No errors

Actual behavior:

node_modules/@parcel/watcher: Running install script, failed in 1.7s
node_modules/@parcel/watcher install$ node-gyp-build
│ node:internal/modules/cjs/loader:1042
│   throw err;
│   ^
│ Error: Cannot find module '/Users/dzmvasilevsky/Work/TulaCo/crexi/[email protected]/node_modules/node-gyp-build/bin.js'
│     at Module._resolveFilename (node:internal/modules/cjs/loader:1039:15)
│     at Module._load (node:internal/modules/cjs/loader:885:27)
│     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
│     at node:internal/main/run_main_module:23:47 {
│   code: 'MODULE_NOT_FOUND',
│   requireStack: []
│ }
│ Node.js v18.13.0
└─ Failed in 1.7s at /Users/dzmvasilevsky/Work/TulaCo/crexi/pnpm-issue/node_modules/@parcel/watcher
 ELIFECYCLE  Command failed with exit code 1.

Additional information:
node -v prints: v16.15.0
Windows, macOS, or Linux?: MacOS

It seems dependencies resolution is happening in a wrong way. Parcel is trying to resolve node-gyp-build from a totally wrong directory.
node_modules are located here /Users/dzmvasilevsky/Work/TulaCo/crexi/web/node_modules while it is looking somewhere like ../../[email protected]/node_modules/node-gyp-build/bin.js while should look at ../node-gyp-build/bin.js. Probably parcel doesn't respect node-linker=hoisted which makes an npm like node_modules structure

@wangsijie
Copy link

same problem

@DzmVasileusky
Copy link
Author

@wangsijie regarding parcel/watcher issue you can just add node-gyp-build to a package.json, that's a hack for sure but it is working

@khludenevav
Copy link

Same problem

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

3 participants