# Not able to run serverless command on CLI

**URL:** <https://forum.serverless.com/t/not-able-to-run-serverless-command-on-cli/9381>\
**Category:** Serverless Framework\
**Created:** [September 18, 2019, 5:18pm UTC](https://forum.serverless.com/t/not-able-to-run-serverless-command-on-cli/9381 "2019-09-18T17:18:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sachin7s](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@sachin7s](https://forum.serverless.com/u/sachin7s)\
**Post date:** [September 18, 2019, 5:18pm UTC](https://forum.serverless.com/t/not-able-to-run-serverless-command-on-cli/9381/1 "2019-09-18T17:18:20Z")

</div>

Serverless framework has been successfully installed on my machine but when i am trying to run serverless login or serverless command its giving error.

Error details are as follows :  
C:\Users\568920\>serverless  
‘serverless’ is not recognized as an internal or external command,  
operable program or batch file.

Microsoft Windows [Version 10.0.15063]  
(c) 2017 Microsoft Corporation. All rights reserved.

C:\Users\568920\>npm install serverless --global  
npm WARN deprecated superagent@3.8.3: Please note that v5.0.1+ of superagent removes User-Agent header by default, therefore you may need to add it yourself (e.g. GitHub blocks requests without a User-Agent header). This notice will go away with v5.0.2+ once it is released.  
C:\Users\568920\AppData\Roaming\npm\serverless → C:\Users\568920\AppData\Roaming\npm\node\_modules\serverless\bin\serverless.js  
C:\Users\568920\AppData\Roaming\npm\slss → C:\Users\568920\AppData\Roaming\npm\node\_modules\serverless\bin\serverless.js  
C:\Users\568920\AppData\Roaming\npm\sls → C:\Users\568920\AppData\Roaming\npm\node\_modules\serverless\bin\serverless.js

> serverless@1.52.0 postinstall C:\Users\568920\AppData\Roaming\npm\node\_modules\serverless  
> node ./scripts/postinstall.js

±-------------------------------------------------+  
| |  
| Serverless Framework successfully installed! |  
| To start your first project, run “serverless”. |  
| |  
±-------------------------------------------------+

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.0.7 (node\_modules\serverless\node\_modules\fsevents):  
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.0.7: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”})

- serverless@1.52.0  
updated 2 packages in 58.038s

C:\Users\568920\>serverless  
‘serverless’ is not recognized as an internal or external command,  
operable program or batch file.

C:\Users\568920\>$ serverless login  
‘$’ is not recognized as an internal or external command,  
operable program or batch file.

C:\Users\568920\>serverless login  
‘serverless’ is not recognized as an internal or external command,  
operable program or batch file.

C:\Users\568920\>serverless  
‘serverless’ is not recognized as an internal or external command,  
operable program or batch file.

Please suggest how to proceed.

---

<div class="post-metadata">

**Author:** ![sachin7s](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@sachin7s](https://forum.serverless.com/u/sachin7s)\
**Post date:** [September 18, 2019, 8:35pm UTC](https://forum.serverless.com/t/not-able-to-run-serverless-command-on-cli/9381/2 "2019-09-18T20:35:22Z")

</div>

I got the resolution… Path variable needs to be set in environment variable

C:\Users\<userId\>\AppData\Roaming\npm

now it working for me.  
Thanks

---

<div class="post-metadata">

**Author:** ![shashikumarsingh1](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@shashikumarsingh1](https://forum.serverless.com/u/shashikumarsingh1)\
**Post date:** [April 16, 2020, 8:24am UTC](https://forum.serverless.com/t/not-able-to-run-serverless-command-on-cli/9381/3 "2020-04-16T08:24:10Z")

</div>

I was also getting the same issue , but when i tried $npm install -g serverless , its working perfectly fine.

So use $npm install -g serverless instead of $npm install serverless

---

<div class="post-metadata">

**Author:** ![yficklis](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/yficklis/32/7227_2.png) [@yficklis](https://forum.serverless.com/u/yficklis)\
**Post date:** [December 15, 2022, 6:50pm UTC](https://forum.serverless.com/t/not-able-to-run-serverless-command-on-cli/9381/4 "2022-12-15T18:50:47Z")

</div>

Do you need install using [chocolatey](https://chocolatey.org/install) to solve this problem:

```auto
choco install serverless

```
