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

Installation fails when using a private npm registry that requires _authToken. #1609

Closed
yukiyokotani opened this issue Sep 15, 2021 · 1 comment · Fixed by #1621
Closed

Comments

@yukiyokotani
Copy link

I'm using AWS CodeArtifact as a npm registry and it fails to install esbuild. More specifically, the install of esbuild itself succeeds, but the execution of install.js defined in 'postinstall' fails. In install.js, node's child_process executes another npm install, but at this time, '_authToken' defined in the .npmrc placed in the project does not take effect. (status 401 is returned.) On the other hand, the registry specification in the .npmrc is still enabled in child_process, so it seems that the .npmrc is not completely ignored.

My .npmrc is defined as follows:

registry=https://my_domain-111122223333.d.codeartifact.us-west-2.amazonaws.com/npm/my-cli-repo/
//my_domain-111122223333.d.codeartifact.us-west-2.amazonaws.com/npm/my_repo/:_authToken=eyJ2ZX...
//my_domain-111122223333.d.codeartifact.us-west-2.amazonaws.com/npm/my_repo/:always-auth=true

I think this is not a problem specific to AWS CodeArtifact, but a common problem with private registries that require 'authToken'.

Has anyone else experienced a similar case?
Also, is there any solution to this problem?
Thanks in advance.

@yukiyokotani
Copy link
Author

yukiyokotani commented Sep 16, 2021

Self solved. I don't know the detailed cause, but if I install esbuild-windows-64, which was failed to install yesterday because of unauthorized error, alone beforehand, and create a cache in CodeArtifact, then esbuild can be installed successfully even on a brand new project.

I still don't know why creating the cache solved the 401 error.

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

Successfully merging a pull request may close this issue.

1 participant