Search code examples
node.jslambdaserverless-framework

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


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.


Solution

  • 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.