-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Installation fails when using a private npm registry that requires _authToken. #1609
Description
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.