-
Notifications
You must be signed in to change notification settings - Fork 52
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
subpackage installation does not always inherit credentials for the registry #60
Comments
checkout solution to related issues here: #124 |
We really need this issue resolved: #126 |
Does this still happen with current npm and node? |
Yes |
Oh this is going to be interesting to fix. I need to figure out what normally injects those credentials and make sure the install script understands them or finds them. |
My finding is that when running preinstall, the CWD is Edit: the fix is either making the preinstall running in Maybe the latter choice should be simpler |
Still the problem |
Symptom
When using private npm registry, on win10, x64 environment the
node-win-x64
npm package will fail to install with a 401 error.Environment Specifics
This was initially discovered in a CI environment using a Private Build agent in Azure DevOps Pipelines, but can be reproduced outside of the CI environment.
This was tried and tested across several Node and npm versions.
Root Cause
The
npm install
that is executed insideinstallArchSpecificPackage
fails because it does not use the registry credentials stored in the project's.npmrc
fileTo Reproduce
.npmrc
to point to the private registry..npmrc
file inside the users home directory. or any other three .npmrc files.npmrc
file inside the project. (this is was Azure Pipelines does it on the Build agent. See NPM Authenticate and here for more info.)npm install node
node-win-x64
Workarounds
.npmrc
in the home directory with the credentials.NPM_CONFIG_USERCONFIG
environment variable with path of .npmrc that has the credentials.Both of these are undesirable because the project's
package.json
and.npmrc
should be all that is needed to install all of the needed npm packages. from either public or private npm registries.Verbose log output below
The text was updated successfully, but these errors were encountered: