azure-docs
azure-docs copied to clipboard
"swa" command not recognised in VS code terminal
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.
- ID: e4071ee2-abad-4d21-7f38-346985c152ae
- Version Independent ID: 4c6f16f1-b40f-0933-9305-de14ea7b9f59
- Content: Set up local development for Azure Static Web Apps
- Content Source: articles/static-web-apps/local-development.md
- Service: static-web-apps
- GitHub Login: @craigshoemaker
- Microsoft Alias: cshoe
@noontz Thanks for your feedback! We will investigate and update as appropriate.
I have raised a question on SO to shed some light on this ;)
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 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.
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.