Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 576
Ryan Shillington Avatar asked Nov 02 '16 16:11

Ryan Shillington


People also ask

Which command install the Serverless Framework correctly?

Open up a terminal and type npm install -g serverless to install Serverless.

How do I start serverless offline?

Steps: Since you already know the basics of Serverless Framework, you must have installed the framework. Next, install the package serverless-offline from npm. Add this installed plugin to your serverless project.


2 Answers

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.

like image 99
Ryan Shillington Avatar answered Sep 19 '22 18:09

Ryan Shillington


This is probably a stupid answer, but might help someone i hope.

I was facing the same problem, even after adding the path. I found that my AppData folder was hidden somehow, making it available fixed the issue for me. (also after making the changes don't forget to open a new CMD :D )

like image 24
Niveditha Karmegam Avatar answered Sep 22 '22 18:09

Niveditha Karmegam