How to use local serverless package when running serverless cli?

From what I can see, when I use the sls CLI , and do for example sls deploy , the global npm serverless package is used.
I want to tinker with the serverless code (to quick-check possible fix for serverless bug…) , however I can’t quicky change the local serverless npm package because it is not used when the CLI is run.
Is there a way to use the locally installed serverless, when I call CLI sls deploy ?

Sorry, if I am missing some obvious general solution, I’m just couple of months into the node.js

Oh, OK, I see the bin is there in the local package too, so it seems:

./node_modules/serverless/bin/serverless deploy

works just fine.

The command you are looking for is npm link.

If you check out the Serverless project somewhere locally, and then run the following commands you will be using your own local version of sls:

npm install
npm link
1 Like