-
Notifications
You must be signed in to change notification settings - Fork 3k
Can't install private npm module from remote system #7995
Comments
Yes, there is a way around this, but it depends on your CI system. Are you using Travis, or Jenkins, or...? The short version is, you can copy your login credentials from your .npmrc (which is where Please let me know if this makes sense, or if my answer fails to address your question. Thanks! |
To build off of this question; We're setting up a
And then setting the environmental variable in our CI system. It works great for deployment, but in local development it requires our developers to manually copy the auth token out of their user Is there a workaround for this? Maybe a way that if the environmental variable isn't set, npm gets the key from the user's |
The workaround I came up with is to run |
Cordova? ;) |
Whoops, wrong issue. ;-) |
+1 for clarification on how this is "supposed" to work |
I think @josiahsprague's workaround should instead be |
both ways should work! |
Hmm, okay. I was having problems, but I think they were deeper than that. Trying to run |
To summarize:- Note the ordering of the below commands for each option:- Option A
Option B
When using Docker, the ordering is important for caching. Setting There are also a bunch of other environments you might be deploying to which would need consideration before deciding on the best approach:
As an environment variable that is passed in during each build seems the best. The question is just how much does this impact developer productivity and deploy times. |
Hello @pcullin-ratio, we haven’t heard back and we’re trying to clean up some issues. If this is still a problem, can you please reply and let us know? We’ll be happy to reopen if necessary. |
@snopeks I do still have an issue that is likely the same. |
Struggling with this as well; We have our credentials in an encrypted file on CI and use a bash script to login with the prompts, which is annoying and sloppy. So is using a token that wasn't generated on the box and can't be automatically updated if it expires/whatever. Why not check for credentials in |
In the solutions above, doesn't |
I just signed up for npm Private Modules, created and published a new private module and can install it just fine on my local machine. I have to run npm login to authenticate with my private credentials before being able to install my private module. This is no problem on my local machine, but when I try to do this in a remote scripted environment such as a CI system, I'm not able to authenticate because
npm login
is an interactive command. That results in the private module not being found duringnpm install
on the remote system.Is there a way around this? I'm totally new to private modules and multiple user accounts for npm...
The text was updated successfully, but these errors were encountered: