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

Update to a newer node versions #41

Closed
jimmywarting opened this issue Nov 11, 2021 · 13 comments
Closed

Update to a newer node versions #41

jimmywarting opened this issue Nov 11, 2021 · 13 comments

Comments

@jimmywarting
Copy link

Some packages use newer features that are not available in your NodeJS version, I where just wondering if you could update it to a newer version.

@USSliberty
Copy link

+1 for this thing
BTW We are using this package with Node 16.13.2 (16.13.2-alpine3.15) since January 2022 and no problems so far.

@gregorymfoster
Copy link

++

@kiduko
Copy link

kiduko commented Jul 7, 2022

For me, It is not work after Node 16.14.2.
After 16.14.2(such as 16.14.3), AWS lambda always return below error.
Error: Runtime exited with error: exit status 254 Runtime.ExitError

@zejji
Copy link

zejji commented Jul 8, 2022

Any news on this from the AWS team? NodeJS 18 will become the active LTS in October 2022, so the RIC support is getting very out-of-date.

@USSliberty
Copy link

Please can you give us an ETA? It is really, really old at this point.

@jimmywarting
Copy link
Author

Would be really nice if you could install the requested node version provided by pacakge.json or something like that...

  "engines": {
    "node": "-----"
  }

@pbadenski
Copy link

Any news?! This library still only supports Node 14 - which is in Maintenance phase since 1 year and 2 even-numbered versions behind current LTS.

The fact that noone from AWS responded to this ticket yet is shockingly unprofessional and shows major disregard for their customer base.

@makeable
Copy link

makeable commented Oct 29, 2022

I contacted AWS support about this a few days ago. They said the lambda team are aware of the issue and are working on it (although quite why they havent responded here...)

They said that as a workaround, you can extract the runtime from the official amazon images with the following command:

docker run --entrypoint /bin/bash public.ecr.aws/lambda/nodejs:16 -c 'yum install -y tar gzip &>/dev/null && tar czf - /var/runtime' | tar xzf -

Note that the included aws-sdk module that gets extracted is not required for the runtime to work.

@DavidArayan
Copy link

Is there any news on this? Amazon officially supports NodeJS 18 however the RIC has yet to be updated. We rely on this module to run our own base images on Lambda.

@makeable Did you manage to get the workaround executing? We get errors related to missing libraries etc when trying to run with NodeJS 18 using following command.

docker run --entrypoint /bin/bash public.ecr.aws/lambda/nodejs:18 -c 'yum install -y tar gzip &>/dev/null && tar czf - /var/runtime' | tar xzf -

@esamattis
Copy link

@DavidArayan

We get errors related to missing libraries etc when trying to run with NodeJS 18 using following command.

What base image are you using? If you are using an Alpine Linux based one it could be because it's using musl libc and the aws image is using glibc. So try 18-slim instead of 18-alpine for example. IRC the slim image uses Debian and thus glibc.

We'll need to figure out a solution / workaround for this too as Node.js 14 goes of end life very soon.

@DavidArayan
Copy link

@esamattis

What base image are you using? If you are using an Alpine Linux based one it could be because it's using musl libc and the aws image is using glibc.

We tried a variety of base images including 18-slim. Perhaps we're doing something wrong with the setup. Is there a list of libraries besides glibc that the RIC relies on that we are missing?

@esamattis
Copy link

esamattis commented Mar 2, 2023

Uh. So yeah. We ported our custom image to use the provided base image. It seems to be very actively updated.

It has yum which can be used to add custom packages very easily. The only downside is that the image size more than doubled from our previous Alpine based one. Will probably look into SlimToolkit for reducing it's size at some point.

@andclt
Copy link
Contributor

andclt commented May 9, 2023

Hi,

We investigated the issue and have updated instructions on how to use the RIC with Node16+.

Summary of the issue:
Starting from [email protected], npm writes logs under the /home/.npm dir: npm/cli#4594
This is not possible inside the Lambda execution env since the fs is read-only. In earlier versions of npm, there was a bug which caused it to silently fail when unable to write cache directory: npm/cli#4996, hence why the runtime was just returning the 254 error code. There are some ways to prevent this:

  1. (preferred) Setting the npm cache folder path to /tmp using a Docker ENV var:
ENV NPM_CONFIG_CACHE=/tmp/.npm
  1. Use yarn instead of npm since it fallbacks to /tmp if the preferred cache folder isn't writable
  2. Setting ENV NPM_CONFIG_CACHE=/tmp/.npm inside Lambda as an env var
  3. Run aws-lambda-ric directly using node instead of using npx

@andclt andclt closed this as completed May 10, 2023
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

10 participants