Giter VIP home page Giter VIP logo

Comments (3)

mndeveci avatar mndeveci commented on May 24, 2024

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.

San-Zer0-786 avatar San-Zer0-786 commented on May 24, 2024

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.

mndeveci avatar mndeveci commented on May 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.