Как да инсталираме nodejs в CentOS 7 ?
По време на разработката на даден софтуер, се налага да използваме и nodejs
Може много бързо да направим инсталацията.
[root@web08 ~]# curl -sL https://rpm.nodesource.com/setup_10.x | bash –
## Installing the NodeSource Node.js 10.x repo…
## Inspecting system…
+ rpm -q –whatprovides redhat-release || rpm -q –whatprovides centos-release || rpm -q –whatprovides cloudlinux-release || rpm -q –whatprovides sl-release
+ uname -m
## Confirming „el7-x86_64“ is supported…
+ curl -sLf -o /dev/null ‘https://rpm.nodesource.com/pub_10.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm’
## Downloading release setup RPM…
+ mktemp
+ curl -sL -o ‘/tmp/tmp.9JzkuiwYKk’ ‘https://rpm.nodesource.com/pub_10.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm’
## Installing release setup RPM…
+ rpm -i –nosignature –force ‘/tmp/tmp.9JzkuiwYKk’
## Cleaning up…
+ rm -f ‘/tmp/tmp.9JzkuiwYKk’
## Checking for existing installations…
+ rpm -qa ‘node|npm’ | grep -v nodesource
## Run `sudo yum install -y nodejs` to install Node.js 10.x and npm.
## 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
[root@web08 ~]# yum install nodejs
[root@web08 ~]# node –version
v10.15.0