Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

serverless: command not found in ubuntu 16.04

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

like image 817
rohan kapoor Avatar asked Jul 16 '17 16:07

rohan kapoor


2 Answers

Try running,

npm config set prefix /usr/local

and then,

npm i -g serverless
like image 141
Manoj Avatar answered Oct 10 '22 05:10

Manoj


Was getting the same error serverless: command not found but instead of NPM was using YARN. To fix it had to execute (or better add to your ~/.bash_profile):

export PATH="$PATH:$(yarn global bin)"

then, if not already installed:

yarn global add serverless
like image 33
Riga Avatar answered Oct 10 '22 05:10

Riga