How does sam local invoke compare with sls invoke local? You can already run your functions locally and debug them with the sls invoke local command, is there any reason to add SAM in this case?
How does sam local invoke compare with sls invoke local?
Yan Cui
1

SAM Local doesn’t mock the Lambda environment, it replicates it. Often the difference won’t matter, in the same way apps often “it works on my machine” before failing in production.

One of the biggest direct advantages is having the precise versions of NodeJS, Python, Java, and system dependencies. This is extra important when using native / C / gyp modules in these languages, but useful otherwise in the face of syntactical differences (especially with Node).