-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[BUG] npm install as root does not run prepare scripts for git dependencies #2062
Comments
I can reproduce a similar problem, but have a slightly different diagnostic. I'm not sure it's related to
The Reproduction Dockerfile
Yields:
Working Dockerfile as non-rootNote that if running as non-root, it works :
Yields:
|
npm If your bug is preproducible on If your issue was a feature request, please consider opening a new RRFC or RFC. If your issue was a question or other idea that was not CLI-specific, consider opening a discussion on our feedback repo |
People went through the trouble of reporting the bug, even providing a deterministic reproduction test case. Six months later, it seems you're basically closing it "in case it was fixed in v7 by any chance", and asking those same people to do redo the work to check for you if the bug is still present. We don't use npm anymore, so I'm not going to; the way I see it, blindly closing this is a loss for the maintainers, not the reporters, a missed opportunity to make npm more robust. That's how I see it when I'm on the other end, at least. My two cents. Happy maintaining and thanks for the work ! |
(This might be the same issue as #1287)
Current Behavior:
If you run "npm install --unsafe-perm" (no other parameters) as root, git dependencies do not have their prepare script called. Other dependencies will be installed as normally.
The same problem applies to "npm link --unsafe-perm".
On other hand, running "npm install --unsafe-perm" or "npm install" as regular user does install all dependencies correctly.
Expected Behavior:
Running "npm install --unsafe-perm" as root becomes equivalent to "npm install" as non root, and all dependencies are installed correctly.
Steps To Reproduce:
This is particularly easy to trigger if for example the package is in TypeScript, which requires a build step.
Environment:
npm 6.14.4 in a docker container (node v10.21.0)
The text was updated successfully, but these errors were encountered: