NPM modules specific to OS causing problems on invoking lambda on AWS

Hi All,

I’m looking to see if there is a way to rebuild or do a npm/yarn install on a lambda function when deploying?

I only ask as I’m currently getting a problem when deploying everything to AWS from my Mac (OSX) as a npm dependency is looking for a OS specific install of the package.

eg. on the Lambda function its looking for
node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-glibc/grpc_node.node
but locally on my Mac its installed
node_modules/grpc/src/node/extension_binary/node-v57-darwin-x64-unknown/grpc_node.node

Hello Tom,

I am having the same problem, have you fixed it?

I have searched for ways to re-run npm install or run npm rebuild on the server, but i think you can’t, because is serverless so it means it creates a new instance to run the function and its dependency whose are zipped already, so i guess one solution could be build the application in an OS compatible with the OS running the function, or change the OS of the instance that is running the function, the fact is that i have not found a way to track what is serverless is doing in AWS. I can see the S3 bucket, but i can not see any of the API Gateway, Cloud Formation, Lambda configuration, and in the S3 Bucket i can not do much