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

[Bug] - NodeJS Package Issue #875

Open
Joe-Zer0 opened this issue Jan 6, 2025 · 6 comments
Open

[Bug] - NodeJS Package Issue #875

Joe-Zer0 opened this issue Jan 6, 2025 · 6 comments
Labels
documentation Improvements or additions to documentation

Comments

@Joe-Zer0
Copy link

Joe-Zer0 commented Jan 6, 2025

Describe the bug
The package nodejs.x86_64 is version 1:18.20.4-1.amzn2023.0.1. This needs to be updated to NodeJS 22, or at least NodeJS 20. As of December 18th 2024, updating NPM will fail due to the the version of NodeJS being <20.

To Reproduce
Steps to reproduce the behavior:

  1. dnf install nodejs -y
  2. npm install npm -g

Expected behavior
NPM should update without error.

Desktop (please complete the following information):
I ran into this issue with the docker image amazonlinux:2023

Additional context
I also tried installing the package nodejs20. But subsequently running node --version gives "bash: node: command not found". Which I believe is also an issue.

EDIT: Adding link to NodeJS releases for easy reference - https://nodejs.org/en/about/previous-releases

@zcobol
Copy link

zcobol commented Jan 7, 2025

@Joe-Zer0 if you install nodejs20 the name of the commands are node-20 and npm-20. After installation use update-alternatives to add node and npm:

[ec2-user@ip-x-x-x-x ~]$ sudo alternatives --install /usr/bin/node node /usr/bin/node-20 0
[ec2-user@ip-x-x-x-x ~]$ sudo alternatives --install /usr/bin/npm npm /usr/bin/npm-20 0

Verify:

[ec2-user@ip-x-x-x-x ~]$ alternatives --list
---cut---
node                    auto    /usr/bin/node-20
npm                     auto    /usr/bin/npm-20
[ec2-user@ip-x-x-x-x ~]$ command -v node
/usr/bin/node
[ec2-user@ip-x-x-x-x ~]$ command -v npm
/usr/bin/npm
[ec2-user@ip-x-x-x-x ~]$ node --version
v20.18.0
[ec2-user@ip-x-x-x-x ~]$ npm --version
10.8.2


@Joe-Zer0
Copy link
Author

Joe-Zer0 commented Jan 7, 2025

Thank you for that workaround. That will be helpful. Hopefully they will update the main nodejs package soon.

@wmanning
Copy link

wmanning commented Jan 7, 2025

I don't think they will. They usually leave the original package name for backwards compatibility and then append a short version number for subsequent releases. They did the same for python.

@Joe-Zer0
Copy link
Author

Joe-Zer0 commented Jan 9, 2025

I believe that is due to python being critical to the functionality of the operation system. Most packages are kept up to date.

@stewartsmith stewartsmith added the documentation Improvements or additions to documentation label Jan 13, 2025
@stewartsmith
Copy link
Member

NodeJS 20 was added in the 2023.3.20231211 release, and can be installed through the nodejs20 package.

We namespace packages such as NodeJS so that we don't force customers to migrate from one major version to the next, rather allowing them to move at their own pace. This is covered for Python in the Python in AL2023
section of the Amazon Linux 2023 User Guide.

I am going to keep this issue open for some Documentation updates that cover nodejs specifically, as I see that isn't currently in our User Guide.

@Joe-Zer0
Copy link
Author

Should the existing syntax be used to allow users to pin a specific version?
sudo apt-get install <package name>=<version>

I think there should be a way to stay on the latest version (and latest LTS version in the case of node) without changing packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants