Skip to content

Instantly share code, notes, and snippets.

@robizz
Last active September 28, 2021 17:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save robizz/dcd5d62f387104e66b584a053aaa9dcf to your computer and use it in GitHub Desktop.
Save robizz/dcd5d62f387104e66b584a053aaa9dcf to your computer and use it in GitHub Desktop.
serverless_multiple_versions_how_to
#!/usr/bin/env bash
# thanks mt-sergio https://github.com/serverless/serverless/issues/1572
npm show serverless versions # bonus: how many sls versions are out there? last version now is 1.7.0
sls -v # bonus: see my serverless current version
cd your/sls/project/folder # make sure that the destination folder contains a node_module folder inside!
npm install serverless@1.7.0 # no global install
alias sls170="~/your/sls/project/folder/node_modules/.bin/sls" # to createpermanent alias add this line to your .bashrc / .zshrc
sls170 -v # should return 1.7.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment