We'll install Node.js using the following steps:
- To install Node.js, add a Node.js yum repository for the stable version 10.x:
[root@ip-172-31-95-213 src]# yum install wget
Please enter 'y' for yes when asked
[root@ip-172-31-95-213 src]# yum install -y gcc-c++ make
[root@ip-172-31-95-213 src]# curl -sL https://rpm.nodesource.com/setup_10.x | sudo -E bash -
The Yum repository is provided by the Node.js official website. After adding the Yum repository, we can start installing Node.js.
- Install Node.js on CentOS with yum:
[root@ip-172-31-95-213 src]# yum install nodejs
Please enter 'y' for yes when asked
When Node.js is installed, NPM will be included as well as many other dependent packages on your system.
- Check the Node.js and NPM version to make sure that our installation has been successful:
[root@ip-172-31-95-213 src]# node -v
v10.15.3
[root@ip-172-31-95-213 src]# npm -v
6.4.1
[root@ip-172-31-95-213 src]# mkdir node-api-postgres
[root@ip-172...