6

I been unable to run npm install on my mac terminal or VSTS code. see below the commands that are trying to run

  1. npm install -g vsts-npm-auth --registry https://registry.npmjs.com--always-auth false
  2. vsts-npm-auth -config .npmrc

error in here

I have an format error on the second command

vsts-npm-auth -config .npmrc zsh: exec format error: vsts-npm-auth 
  1. Run: npm install
  2. run npm start`

As you can see, I can not even past the first command.

I had try clear the proxy assign a proxy And my network is completely fine, I ping https://registry.npmjs.com and it works ok I also did

-npm config set registry https://registry.npmjs.org/

npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.com--always-auth/vsts-npm-auth failed, reason: getaddrinfo ENOTFOUND registry.npmjs.com--always-auth
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'
3
  • Hi @Pxaml, is any update here? Feel free to let me know the latest news. Commented Sep 21, 2020 at 9:19
  • Nope ! I wish . I end up using a windows. I couldn't figure this out Commented Sep 22, 2020 at 2:28
  • Hi @Pxaml, Could you please share the latest error message here? A screenshot is better. Thanks. Commented Sep 22, 2020 at 5:45

2 Answers 2

11

vsts-npm-auth is not supported for Linux/Mac.

from Azure DevOps Documentation / Set up your client's npmrc

  1. First option is generating a token

Set up authentication on your dev box / Linux or Mac

In the Project setup section, select Other

  1. Second option is platform agnostic library

better-vsts-npm-auth

Sign up to request clarification or add additional context in comments.

3 Comments

better-vsts-npm-auth works perfectly on macOS - also supports yarn if you use .yarnrc.yml - update the npmAuthToken attribute with the refresh token generated from ~/.npmrc
better-vsts-npm-auth is for sure the best way to setup on the Mac IMO.
Thanks, better-vsts-npm-auth works perfect for Debia/Linux +100
2

You are missing a space before the --always-auth:

npm install -g vsts-npm-auth --registry https://registry.npmjs.com --always-auth false
# Space was missing here -----------------------------------------^

2 Comments

Thank you , Iam missing something on the second command as well vsts-npm-auth -config .npmrc zsh: exec format error: vsts-npm-auth
It didn't work on mac. It looks that on mac vsts-npm-auth is installed in the npm as a windows executable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.