serverless: command not found in ubuntu 16.04
Try running,
npm config set prefix /usr/local
and then,
npm i -g serverless
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
my recomendation here is to allways install the serverless framework as a dev dependency (npm install serverless --save-dev
) specially if you're working in a team where each member can have its own version of the framework. After that, you can call the framework using npm scripts. For example, you can create a new entry in the scripts section like this: "deploy" : "serverless deploy"
and call it using npm run deploy
.