Description of changes:
Update dependencies and distros
Starting from npm@8.6.0, npm writes logs under the /home/.npm dir: https://github.com/npm/cli/pull/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: https://github.com/npm/cli/issues/4996, hence why the runtime was just returning the 254 error code. There are some ways to prevent this:
Setting the npm cache folder path to /tmp using a Docker ENV var:
Issue #, if available:
41 #53
Description of changes: Update dependencies and distros
Starting from
npm@8.6.0
, npm writes logs under the /home/.npm dir: https://github.com/npm/cli/pull/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: https://github.com/npm/cli/issues/4996, hence why the runtime was just returning the 254 error code. There are some ways to prevent this:/tmp
using a Docker ENV var:yarn
instead ofnpm
since it fallbacks to /tmp if the preferred cache folder isn't writableENV NPM_CONFIG_CACHE=/tmp/.npm
inside Lambda as an env varaws-lambda-ric
directly using node instead of usingnpx
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.