Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module 'aws-xray-sdk' in nodejs Lambda #617

Open
yschondorf opened this issue Oct 16, 2023 · 0 comments
Open

Cannot find module 'aws-xray-sdk' in nodejs Lambda #617

yschondorf opened this issue Oct 16, 2023 · 0 comments

Comments

@yschondorf
Copy link

I am trying to use aws-xray-sdk.
package.json has these dependencies:

"dependencies": {
"aws-sdk": "^2.1357.0",
"aws-xray-sdk": "^3.3.0"
}

Lambda function has this code:

const AWSXRay = require('aws-xray-sdk');
const AWS = AWSXRay.captureAWS(require('aws-sdk'));

I installed aws-xray-sdk using "npm install aws-xray-sdk --save" and it is installed successfully.

However, when I invoke my Lambda function I get:
"Error: Cannot find module 'aws-xray-sdk'\nRequire stack:\n- /var/task/authentication.js\n- /var/runtime/index.mjs",

Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant