Install NPM and NodeJS

I know it is not a Rocky Linux problem. I need a little help to install and update Nodejs and npm. I want to install Gatsby.

That I have done:

dnf module list nodejs
dnf module installl nodejs:16
npm install -g npm@8.9.0
npm install -g gatsby-cli

This are the error messages:

npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher
npm WARN old lockfile 
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile 
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm WARN deprecated async-cache@1.1.0: No longer maintained. Use [lru-cache](http://npm.im/lru-cache) version 7.6 or higher, and provide an asynchronous `fetchMethod` option.
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated devcert@1.2.0: critical regex denial of service bug fixed in 1.2.1 patch
npm WARN deprecated subscriptions-transport-ws@0.9.19: The `subscriptions-transport-ws` package is no longer maintained. We recommend you use `graphql-ws` instead. For help migrating Apollo software to `graphql-ws`, see https://www.apollographql.com/docs/apollo-server/data/subscriptions/#switching-from-subscriptions-transport-ws    For general help using `graphql-ws`, see https://github.com/enisdenjo/graphql-ws/blob/master/README.md

It’s worth noting that those four commands comprise two different things.

The first two related to installing nodejs using the official Rocky repos, and as I understand it, there were no errors with that part? The second two commands are trying to install things that are not part of Rocky; npm itself maybe, but who knows if those other packages are safe?

Hi Joerg,

Just relax, it has no error at all, those messages just tell you that you have out-dated packages installed. Run command ‘npm audit’ (you may need super user right to do it), and follow the output instructions to update your packages.

Remark: The default version of node.js of Rocky Linux is 14.x, you better switch the node.js on your system to version 16.x by following commands;

dnf module reset nodejs
dnf module enable nodejs:16

Cheers,
Athens

1 Like

But when you apply security updates to Rocky, make sure any alternate versions are also patched.