Hi All, I have built a sample skill, which has some Lambda function with node.js environment.The code works fine if i execute my .js file in node.js However if i use require('restler') in AWS Lambda edit code environment, I get the error "Exception: Error: Cannot find module 'restler'". Does lambda has restler library if not is there any alternative ? Thanks, John
At least with Java code, Lambda provides a way that you can package libraries with your own code so they're available on your function's classpath. I haven't done much with Node, but I'd expect there is a similar mechanism.
Hi john, You [b]need[/b] to include node module(s) with the rest of your js source code when you upload it. You can find instructions for loading and testing a module on AWS ( to make sure it'll play nice with lambda) here:
https://aws.amazon.com/blogs/compute/nodejs-packages-in-lambda/ I've done some testing with [b]restler[/b] and it worked fine for me (your mileage may vary, etc.) just uploading the module that I installed using npm on my Mac.