1
votes

I need to add a global registry to my computer for a project I am working on. It cannot reside locally in the project - I know this works, but for the sake of this project I can't keep it there.

I have tried npm config set registry... but I am working through VSTS, and it provides an already generated token. When I attempted it, after setting it, entering username/pw/email... it returned:

Registry returned 404 for PUT on undefined npm ERR!

There are options for windows only:

Recommended (for Windows users):Install and run the auth helper

npm install -g vsts-npm-auth --registry https://registry.npmjs.com --always-auth false

vsts-npm-auth -config .npmrc

But the alternative is to add it manually. It gives me a token, and I just need to somehow add this globally... and I have found zero online that has helped.

Just searched and found this... irony? enter image description here

Any ideas?

2
Do you solve this issue?starian chen-MSFT
@starianchen-MSFT, I did not...steven.gissubel

2 Answers

1
votes

You just need to copy the generated token and paste to .npmrc file in $home for mac system.

More information: Set up your client's npmrc

1
votes

you can go to finder and Hold down the Command, Shift and H keys: cmd + shift + H. It will take you to home directory. npmrc file usually be saved there if its configured to be global. If you don't see it there, Hold down the Command, Shift and Period keys: cmd + shift + [.]. It will display all hidden file in that directory. You can then see it. Right click on it and open it using text editor and add required entries.

If the .npmrc file is still not there in hidden files list, then .npmrc file is not configured to be global. you can create one in this directory using touch command on mac.