serverless: command not found in ubuntu 16.04

rohan kapoor picture rohan kapoor · Jul 16, 2017 · Viewed 14.4k times · Source

I am trying to set up the AWS Serverless framework in Ubuntu 16.04 LTS. I installed Node.js and have also installed Serverless using the following command: npm install -g serverless in the terminal. But when I try to run serverless it returns an error saying serverless: command not found. Below is a screenshot for reference:

Command not found error

Answer

Manoj picture Manoj · Jul 16, 2017

Try running,

npm config set prefix /usr/local

and then,

npm i -g serverless