azure-docs icon indicating copy to clipboard operation
azure-docs copied to clipboard

"swa" command not recognised in VS code terminal

Open noontz opened this issue 2 years ago • 3 comments

Im trying to follow your guide

Already at the Get Started part I stumble on this one:

Run "npm install @azure/static-web-apps-cli" from the terminal in VS code

Install fine but now I have 5 vulnerabilities in my project?

Run "swa init" from the terminal in VS code

This is what I get:

PS H:\Repos\AzureTest\test> swa start swa : The term 'swa' 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

  • swa start
  •   + CategoryInfo          : ObjectNotFound: (swa:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    
    
    

I might be doing something wrong, but I am following the documentation?


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

noontz avatar Nov 29 '22 10:11 noontz

@noontz Thanks for your feedback! We will investigate and update as appropriate.

Naveenommi-MSFT avatar Nov 29 '22 14:11 Naveenommi-MSFT

I have raised a question on SO to shed some light on this ;)

noontz avatar Nov 30 '22 08:11 noontz

As per the answer on SO you need to install globally to follow the rest of the documentation e.g. npm install @azure/static-web-apps-cli should be npm install -g @azure/static-web-apps-cli Alternatively npx should be used (and documented)

noontz avatar Dec 02 '22 12:12 noontz

@noontz Thank you for your feedback! I have raised a PR by making those documentation changes and changes will go live soon once it is approved by content author.

We will close this out, but if you feel you need more information, please just let us know.

Venkateshdodda-MSFT avatar Dec 07 '22 05:12 Venkateshdodda-MSFT

Please reopen this issue as the documentation has not been updated. It still recommends installing @azure/static-web-apps-cli as a dev dependency and there's no indication that you need to run npx swa for the command to work.

end-user avatar Jan 19 '24 22:01 end-user