Comments (6)
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.
I managed to resolve - it was a Windows error. Apparently there is a length limit in reading a filepath. I did the following to get this resolved:
https://superuser.com/questions/1807770/enable-long-paths-on-win-11-home
Definitely an issue that wasted time, good ol' Windows...
from aws-sam-cli.
Thanks for letting us know that you've resolve the issue (a Windows long path problem), I'm going to go ahead and resolve this. If there are any other issues that you face with SAM CLI, feel free to open a new issue to report it.
from aws-sam-cli.
⚠️ COMMENT VISIBILITY WARNING⚠️
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
from aws-sam-cli.
Related Issues (20)
- SAM Does not build the application, returns "PythonPipBuilder:ResolveDependencies failed HOT 4
- Bug: Missing DockerContext doesn't fail validation HOT 2
- `sam init` fails to deploy a standard sample on Windows platform HOT 3
- Bug: sam local start-api not working in a docker-out-of-docker setup, due to an empty /var/task directory. HOT 2
- Bug: TITLE"Invalid API identifier specified" when attaching resources to an existing AWS::ApiGatewayV2::Api HOT 2
- Bug: sam build - UnsupportedBuilderException HOT 3
- SAM build crashes using terraform HOT 9
- Bug: sam local start-api - AttributeError HOT 9
- SAM local invocation with CDK generated template with typescript not able to find module index (index.mjs) HOT 5
- How to add tags with sam deploy HOT 7
- Bug: Got issue when using 1.116.0_1 for deployment HOT 2
- Bug: [WinError 3] The system cannot find the path specified HOT 4
- Feature request: Deploy Lambdas with concurrency HOT 1
- Bug: sam sync with python causes endless cpu saturation HOT 10
- Bug: sam build - EmptyKeyError HOT 1
- Bug: Unable to run sam local invoke on Apple Silicon HOT 13
- Cannot sam local start-api without specifying an image HOT 1
- Bug: sam local start-api - ReadTimeout HOT 3
- Bug: "Timed out while attempting to establish a connection to the container" error after fresh install of Docker and AWS SAM HOT 3
- Bug: sam build - JSONDecodeError HOT 1
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.