How to check minor Node.js version in AWS Lambda and Elasticbeanstalk? - node.js

I'm relying on Node version 12.17.x to make use of a specific feature (AsyncLocalStorage) in Lambda and Elasticbeanstalk. But for some reason, the Node.js version does not seem to publicly available. Why do they think that platform "12.x" tells me the real Node version? I want to know the exact minor and patch version, or at least give some news about it...
I had to create a test lambda function that prints process.version, but surprisingly, platform 12.x still uses v12.16. When will they upgrade to the latest stable version that came out more than 2 weeks ago? Are they publishing those releases somewhere? Google tells me nothing useful.
The same applies to Elasticbeanstalk instances. Node v12.17 does not exist in /opt/elasticbeanstalk/node-install/*

I've just checked in our sentry and the current version is newer-v12.18.4 so you can safely use AsyncLocalStorage now on v12 lambdas.
But AWS should really show this in the lambda administration panel. The fact that this is not shown anywhere and we have to use console logs or third party tools to get this info is a very poor DX.

Related

How do I get exact version numbers of NodeJS my AWS lambda currently supports?

How do I get the exact versions of Node.js, e.g. 18.1.2 that I can run on AWS lambda? The documentation gives me 18.x which is not very specific.
Seems like:
AWS doesn't show node.js version in the UI, so you need to console.log(process.version)
the version can change at any time, no one will notify you

nodejs code analysis tool for specific version

We have a project built with NodeJS. With time the version upgrades are very necessary but while updating the version, if we do not have enough test cases, something might break and we may know it far later. Such a scenario was introduced when replaceAll method was used in some part of the code. But replaceAll is not supported until NodeJS 15 or later. So we run into trouble after merging the code.
Can we check whether the NodeJS code works or not for a specific version?
Demonstration:
I've created a repository on GitHub for this with a workflow to demonstrate the problem. See this run https://github.com/kiranparajuli589/node-check/runs/7573211393?check_suite_focus=true
Here I've used Node 14 and properly configured the engines keyword in the package.json but still, the linter is not reporting about the usages of such functions that are not available.

Lambda Function NodeJS version always reverted to 12.x

I am running javascript Lambda functions that required NodeJS version 14.x. I can manually set this in the AWS Lambda console here (screenshot below), but every time I use the amplify CLI to push a change of the function, it gets reverted back to 12.x. I can't find any reference to the NodeJS version in the local amplify files, or online. Is there a way to keep it from reverting every time?
This is what the Lambda console option looks like, which I edit to 14.x constantly, but it changes back to 12.x:
Currently (26 July 2021), AWS Amplify only support NodeJS ver 12.x. Please see the Supported Lambda runtimes paragraph in the Amplify Docs for reference.
While #matsev's answer looks to be the official version supported by AWS, I noticed that while some of my functions continued to be reverted to 12.x, others stayed at 14.x even after a push. The ones that stayed at 14.x were my more recently created functions.
It turns out, you can edit the *.cloudformation-template.json for each function to set the nodejs version! This file did not appear in my vscode search due to a previous developer hiding it using files.exclude. This is likely a good best practice because the file is meant to be just edited using the amplify CLI, but there are obviously some settings that are not part of the CLI commands. Another example is the timeout parameter in here.
The file is located at: amplify/backend/function/FUNCTION_NAME/FUNCTION_NAME-cloudformation-template.json
The parameter to edit is: `Resources.LambdaFunction.Properties.Runtime = "nodejs14.x"

Available Node Package Module that supports amazon product api version 5.0

Amazon recently published its Amazon Product Advertising API v5.0 for Amazon Affiliate Program. From 31st October 2019, previous version 4.0 of API will be taken down and only v5.0 will be supported to access Amazon products programmatically.
With these changes, most available node modules and applications will no longer work with V5.0. For this Amazon PA-API 5.0, Amazon has released an SDK for PHP, NodeJs, Python and, Java. However, using the SDK for NodeJs may require time to configure.
That being said, is there an available Node Package module that we can use to easily start integrating our application?
There are a few NPM wrappers that are available today that help you use Paapi 5.0 for NodeJS. All of this module uses the amazon SDK for their code.
amazon-paapi - By far my favorite as it uses simple to understand node syntax. Adding parameters is much like how you do it using amazon scratchpad. It also support custom parameter options.
amazon-pa-api50 - Another great module. However, as of this writing, I found some limitations on optional parameters you can add to some operations.
apaw - alternative option.

Azure Functions and Node.js

Let's say I have a Node.js app I want to build with a TimerTrigger on Azure Functions.
What would be the best way to develop it? I already tried setting the NODE_DEFAULT_VERSION to 8.7.0 but it's still giving me problems like incorrect syntax when I know the Node can handle it.
Does anyone have any experience building Node.js apps on Azure?
In the current version of the function runtime, you cannot choose the Node version. But in the next version, which is currently in Preview, you can and will be able to pick 8.7.0. See https://learn.microsoft.com/en-us/azure/azure-functions/functions-versions for details.

Resources