Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vsts-npm-auth is not recognized as the name of a cmdlet

First I run npm install -g vsts-npm-auth command and I get a message that [email protected] installed. But then when I'm running vsts-npm-auth -config .npmrc command I get the following error message:


vsts-npm-auth : The term 'vsts-npm-auth' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1

  • vsts-npm-auth -config .npmrc
  •   + CategoryInfo          : ObjectNotFound: (vsts-npm-auth:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    
like image 407
Denis Avatar asked Sep 29 '20 19:09

Denis


3 Answers

Try to: npx vsts-npm-auth -config .npmrc

like image 52
Vlad Avatar answered Oct 24 '22 13:10

Vlad


Since you mentioned the package vsts-npm-auth has been installed successfully, but still encountered the "The term 'vsts-npm-auth' is not recognized" error. It's likely that the npm modules folder is not in your PATH.

Please run below command to append your npm module folder into PATH:

setx path "%APPDATA%\npm;%path%"  

Then you should be able to execute vsts-npm-auth -config .npmrc.

like image 38
Mengdi Liang Avatar answered Oct 24 '22 14:10

Mengdi Liang


For Visual Studio (VS) Code try killing and restarting the terminal session and running again.

Image: VS Code terminal trash icon

like image 27
SushiGuy Avatar answered Oct 24 '22 14:10

SushiGuy