How to upgrade the nodejs NPM version of CentOS

Time:2020-8-9

Delete node

yum remove nodejs

Delete Yum source

CD to Yum source configuration folder:cd /etc/yum.repo.d, delete the source starting with node;
Clear Yum cacheyum clean all

Install node

curl -sL https://rpm.nodesource.com/setup_10.x | bash -

yum install -y nodejs

Update NPM

npm install [email protected] -g
The command: NPM – V output version number is successfully installed.