After installing serverless on Windows 10, I can't run "serverless" at the command prompt

Ryan Shillington picture Ryan Shillington · Nov 2, 2016 · Viewed 9.1k times · Source

I installed NodeJS, which seems to work fine. Running npm worked fine and I could install packages. Then I ran

npm install serverless -g

which also ran fine. But when I try to run:

serverless

at the windows command prompt, I get an error about the command not being found.

'serverless' is not recognized as an internal or external command,
operable program or batch file.

I've included the answer is below.

Answer

Ryan Shillington picture Ryan Shillington · Nov 2, 2016

The issue for me was that I was missing the following directory in my Windows PATH env variable:

%AppData%\npm

Once I added that, I could run serverless, sls, etc.