Comments (3)
Hi there,
Can you provide more details of your lambda function? Especially, if you can share simplified version of package.json
file, it will help us a lot to find the root cause.
I was able to build a node20.x lambda function with following package.json
(dependencies);
{
"name": "hello_world",
"version": "1.0.0",
"description": "hello world sample for NodeJS",
"main": "app.js",
"author": "SAM CLI",
"license": "MIT",
"dependencies": {
"axios": ">=1.6.0",
"aws-sdk": "2.1551.0"
},
"scripts": {
"test": "mocha tests/unit/"
},
"devDependencies": {
"chai": "^4.3.6",
"mocha": "^10.2.0"
}
}
from aws-sam-cli.
Hi there,
Can you provide more details of your lambda function? Especially, if you can share simplified version of
package.json
file, it will help us a lot to find the root cause.I was able to build a node20.x lambda function with following
package.json
(dependencies);{ "name": "hello_world", "version": "1.0.0", "description": "hello world sample for NodeJS", "main": "app.js", "author": "SAM CLI", "license": "MIT", "dependencies": { "axios": ">=1.6.0", "aws-sdk": "2.1551.0" }, "scripts": { "test": "mocha tests/unit/" }, "devDependencies": { "chai": "^4.3.6", "mocha": "^10.2.0" } }
Thanks for replying
All lambda functions in the project use this package.json:
`
{
"name": "lambda",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": "",
"dependencies": {
"@aws-sdk/client-secrets-manager": "^3.423.0",
"@aws-sdk/client-ses": "^3.449.0",
"ajv": "^8.12.0",
"ajv-formats": "^2.1.1",
"axios": "^1.5.1",
"jszip": "^3.10.1",
"sanitize-html": "^2.11.0"
},
"devDependencies": {
"eslint": "^8.52.0"
}
}
`
I wondered at the start - if the error is happening due to a file not found part of "@aws-sdk/client-ses": "^3.449.0",
Is it failing because client-ses was upgraded to 3.5 recently, so the ^ would install 3.5 accordingly?
I then forced it to be 3.449.0 but unfortunately, this didn't help fix it.
It is very strange, during Copying artifacts from
C:\Users\userName\OneDrive\Desktop\AT\project-name.aws-sam\build\CognitoClinicUserPoolStack\PreSignUpFunctio
n to
C:\Users\userName\OneDrive\Desktop\AT\project-name.aws-sam\build\UserApiStack\GetContentFromTestFunct
ion
this all works, but then the next one fails, saying it is unable to find a node_module part of client-ses. Not sure what control I have over that instead of npm install, the module relies on other node modules which I cannot edit directly as it will overwrite
from aws-sam-cli.
Thanks for providing the package.json
file. I've applied that to a hello world template and my sam build
succeeds with no issues.
Error: [Errno 2] No such file or directory: 'C:\\Users\\userName\\OneDrive\\Desktop\\AT\\project-name\\.aws-sam\\build\\ManagementFunctionsStack\\UploadPaidContentZipFileFunction\\node_modules\\@aws-sdk\\client-ses\\node_modules\\@aws-sdk\\credential-provider-process\\dist-types\\ts3.4\\getValidatedProcessCredentials.d.ts'
One problem I see about this one above is that there are multiple node_modules
in the path, I would only expect there should be one node_modules
and dependencies should live there. For instance, after my build if I list the files under .aws-sam/build/HelloWorldFunction/node_modules/@aws-sdk/client-ses
, there is no node_modules
folder.
❯ ls -ltra .aws-sam/build/HelloWorldFunction/node_modules/@aws-sdk/client-ses
total 120
drwxr-xr-x 28 user wheel 896 6 Feb 14:17 ..
-rw-r--r-- 1 user wheel 11390 6 Feb 14:17 LICENSE
drwxr-xr-x 17 user wheel 544 6 Feb 14:17 dist-cjs
drwxr-xr-x 17 user wheel 544 6 Feb 14:17 dist-es
-rw-r--r-- 1 user wheel 3670 6 Feb 14:17 package.json
drwxr-xr-x 8 user wheel 256 6 Feb 14:17 .
-rw-r--r-- 1 user wheel 41373 6 Feb 14:17 README.md
drwxr-xr-x 18 user wheel 576 6 Feb 14:17 dist-types
Is it possible to provide a simplified example for us to reproduce it?
from aws-sam-cli.
Related Issues (20)
- Feature request: allow to choose one authorizer when there's more than one HOT 4
- Bug: When running sam deploy in github ci/cd, got error Unable to export., TypeError: sequence item 0: expected str instance, bytes found HOT 8
- --image_repositories not working HOT 3
- SAM build still fails for go with `--use-container` HOT 7
- posted prematurely ... more testing required HOT 1
- Bug: Windows deploys broken because CRLF not converted to LF for bash/shell scripts HOT 3
- Bug: sam init - AttributeError HOT 2
- Provide proper release artifacts HOT 7
- Deploy command freezes when tag containing space is provided in samconfig file HOT 2
- Bug: Unable to debug typescript sam app via VScode breakpoints HOT 2
- Concurrent requests to `sam local start-api` cause crash in _clean_decompressed_paths function and 502 in browser HOT 4
- Unable to upload artifact using SAM CLI Version 1.109.0 HOT 15
- An HTTP Client raised an unhandled exception: sequence item 0: expected str instance, bytes found HOT 4
- Is FullAccess Role secure? HOT 3
- Bug: sam local invoke - KeyError HOT 1
- Bug: sam local invoke - ReadTimeout HOT 2
- Prevent Image Build/Rebuild for sam local start-api ? HOT 1
- Bug: sam local start-api --warm-containers doesn't work on docker HOT 8
- Bug: Cannot push image to public Repository on ECR HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-sam-cli.