You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use run npm install to pull packages from a private repository that requires authentication.
Normally I would put .npmrc file with the proper token into user's home but this didn't work. I also tried few locations that I could think of and in particular ${NPM_HOME_DIR} and ${S} but neither did any good.
What would be correct location to put the .npmrc file for authentication to work.?
The text was updated successfully, but these errors were encountered:
dtoubelis
changed the title
How to authenticate to private repository
Authenticating to a private repository
Mar 15, 2018
What thrown me off is that we use node-6 in the image but npm-base class uses nodejs-native for running npm. We were setting preferred version for nodejs but not for nodejs-native and as a result nodejs-7/npm-4 were used by oe_runnpm for pulling dependencies.
Apparently there is a subtle difference in how authentication works between node6/npm3 and node7/npm4 (the always-auth=true part) and it took me only 2 days to figure this out :-)
And this is the right way to setup preferred version:
I'm trying to use run
npm install
to pull packages from a private repository that requires authentication.Normally I would put
.npmrc
file with the proper token into user's home but this didn't work. I also tried few locations that I could think of and in particular ${NPM_HOME_DIR} and ${S} but neither did any good.What would be correct location to put the
.npmrc
file for authentication to work.?The text was updated successfully, but these errors were encountered: