There are a few different points here:
.npmrc
file created.Running npm config ls -l
will show you all the implicit settings for npm, including what it thinks is the right place to put the .npmrc
. But if you have never logged in (using npm login
) it will be empty. Simply log in to create it.
Another thing is #2. You can actually do that by putting a .npmrc
file in the NPM package's root. It will then be used by NPM when authenticating. It also supports variable interpolation from your shell so you could do stuff like this:
; Get the auth token to use for fetching private packages from our private scope
; see http://blog.npmjs.org/post/118393368555/deploying-with-npm-private-modules
; and also https://docs.npmjs.com/files/npmrc
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
Pointers