3

I have a private npmjs repo that I would like to install into a project. What is the url I can use to that will include the credentials so everything works ok on my build server? Something like:

npm install https://username:password@npmjs.com/@myorg/radlibrary

Jake Pearson
  • 27,069
  • 12
  • 75
  • 95

1 Answers1

1

You need to run npm login, which persists the credentials on the current machine, for the current local user. This is an interactive prompt, so you'll need to use something like the expect command to automate it (or just do it once manually and it'll stick).

I posted a script that can be used to constantly re-login/update these credentials here. In my case, I'm logging into a private (self-hosted) repo, which periodically expires the credentials, so a more thorough re-login test is needed.

Ryan
  • 1,171
  • 1
  • 10
  • 23