NodeJS Labs Introduction

Hello!

Just started with the DevOps course and I’m getting an error when trying to install NodeJS.

thor@host01 ~$ curl -sL https://rpm.nodesource.com/setup_14.x | sudo bash -
================================================================================
================================================================================

                              DEPRECATION WARNING                            

  Node.js 14.x is no longer actively supported!

  You will not receive security or critical stability updates for this version.

  You should migrate to a supported version of Node.js as soon as possible.
  Use the installation script that corresponds to the version of Node.js you
  wish to install. e.g.

   * https://rpm.nodesource.com/setup_16.x - Node.js v16 "Gallium"
   * https://rpm.nodesource.com/setup_18.x - Node.js v18 LTS "Hydrogen" (recommended)
   * https://rpm.nodesource.com/setup_19.x — Node.js v19 "Nineteen"
   * https://rpm.nodesource.com/setup_20.x — Node.js v20 "Iron" (current)

  Please see https://github.com/nodejs/Release for details about which
  version may be appropriate for you.

  The NodeSource Node.js distributions repository contains
  information both about supported versions of Node.js and supported Linux
  distributions. To learn more about usage, see the repository:
    https://github.com/nodesource/distributions

================================================================================
================================================================================

Continuing in 20 seconds ...


================================================================================
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
================================================================================

                           SCRIPT DEPRECATION WARNING                    

  
  This script, located at https://rpm.nodesource.com/setup_X, used to
  install Node.js is deprecated now and will eventually be made inactive.

  Please visit the NodeSource distributions Github and follow the
  instructions to migrate your repo.
  https://github.com/nodesource/distributions

  The NodeSource Node.js Linux distributions GitHub repository contains
  information about which versions of Node.js and which Linux distributions
  are supported and how to install it.
  https://github.com/nodesource/distributions


                          SCRIPT DEPRECATION WARNING

================================================================================
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
================================================================================

TO AVOID THIS WAIT MIGRATE THE SCRIPT
Continuing in 60 seconds (press Ctrl-C to abort) ...


## Installing the NodeSource Node.js 14.x repo...


## Inspecting system...

+ uname -m
centos-release-7-6.1810.2.el7.centos.x86_64
exec redhat-release
Release package: centos-release-7-6.1810.2.el7.centos.x86_64

## Confirming "el7-x86_64" is supported...

+ curl -sLf -o /dev/null 'https://rpm.nodesource.com/pub_14.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm'

## Downloading release setup RPM...

+ mktemp
+ curl -sL -o '/tmp/tmp.BKVftt4HgH' 'https://rpm.nodesource.com/pub_14.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm'

## Installing release setup RPM...

+ rpm -i --nosignature --force '/tmp/tmp.BKVftt4HgH'

## Cleaning up...

+ rm -f '/tmp/tmp.BKVftt4HgH'

## Checking for existing installations...

+ rpm -qa 'node|npm' | grep -v nodesource

## Run `sudo yum install -y nodejs` to install Node.js 14.x and npm.
## You may run dnf if yum is not available:
     sudo dnf install -y nodejs
## You may also need development tools to build native addons:
     sudo yum install gcc-c++ make
## To install the Yarn package manager, run:
     curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
     sudo yum install yarn

thor@host01 ~$ 
thor@host01 ~$ 
thor@host01 ~$ nodejs
-bash: nodejs: command not found
thor@host01 ~$ sudo yum install -y nodejs
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
 * base: tx-mirror.tier.net
 * epel: mirror.team-cymru.com
 * extras: mirror.wdc2.us.leaseweb.net
 * updates: mirror.team-cymru.com
Resolving Dependencies
--> Running transaction check
---> Package nodejs.x86_64 2:18.16.0-1nodesource will be installed
--> Processing Dependency: libstdc++.so.6(GLIBCXX_3.4.21)(64bit) for package: 2:nodejs-18.16.0-1nodesource.x86_64
--> Processing Dependency: libc.so.6(GLIBC_2.28)(64bit) for package: 2:nodejs-18.16.0-1nodesource.x86_64
--> Processing Dependency: libm.so.6(GLIBC_2.27)(64bit) for package: 2:nodejs-18.16.0-1nodesource.x86_64
--> Processing Dependency: libstdc++.so.6(CXXABI_1.3.9)(64bit) for package: 2:nodejs-18.16.0-1nodesource.x86_64
--> Processing Dependency: libstdc++.so.6(GLIBCXX_3.4.20)(64bit) for package: 2:nodejs-18.16.0-1nodesource.x86_64
--> Finished Dependency Resolution
Error: Package: 2:nodejs-18.16.0-1nodesource.x86_64 (nodesource)
           Requires: libstdc++.so.6(GLIBCXX_3.4.20)(64bit)
Error: Package: 2:nodejs-18.16.0-1nodesource.x86_64 (nodesource)
           Requires: libstdc++.so.6(GLIBCXX_3.4.21)(64bit)
Error: Package: 2:nodejs-18.16.0-1nodesource.x86_64 (nodesource)
           Requires: libm.so.6(GLIBC_2.27)(64bit)
Error: Package: 2:nodejs-18.16.0-1nodesource.x86_64 (nodesource)
           Requires: libstdc++.so.6(CXXABI_1.3.9)(64bit)
Error: Package: 2:nodejs-18.16.0-1nodesource.x86_64 (nodesource)
           Requires: libc.so.6(GLIBC_2.28)(64bit)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
thor@host01 ~$ sudo apt-get update sudo apt-get install -y ca-certificates curl gnupg
sudo: apt-get: command not found
thor@host01 ~$ node
-bash: node: command not found

Need help please.

Found this and it worked for me:
https://stackoverflow.com/questions/75854828/cant-install-node-js-ver-18-on-centos-7-9

1 Like

That is a very impressive deprecation warning. It even flashes red for you. For now, to complete the lab, continue to install NodeJS 14, but as you’ve pointed out, installing NodeJS 18LTS is what we should be asking you to do. I’ve notified the lab team accordingly.

2 Likes