[Nodejs] Linux system to build Nodejs

Node.js is a platform based on a built Chrome JavaScript run-time.

Node.js is an event-driven I / O server-side JavaScript environment, based on Google's V8 engine, the V8 Javascript execution speed is very fast, very good performance.

1. Check whether the installation nodejs and npm package management tool

[root@tanbaobao ~]# rpm -qa nodejs
[root@tanbaobao ~]# rpm -qa npm
或
[root@tanbaobao ~]# whereis nodejs
[root@tanbaobao ~]# whereis npm

2. Download and install nodejs

  After you can download (select linux version) uploaded to the server, I am here to direct download using wget directly on the server: http://nodejs.cn/download/

[tanbaobao the root @ ~] # CD / usr / local / the src / 
[the root @ tanbaobao the src] # wget https://npm.taobao.org/mirrors/node/v12.14.1/node-v12.14.1-linux-x64 .tar.xz 

# decompression 
[root @ tanbaobao src] # tar -xvf the Node-v12.14.1-Linux-x64.tar.xz 
# to change the name and move to the specified directory 
[root @ tanbaobao src] # mv the Node-V12. NodeJS-x64-Linux-14.1 
[the root @ tanbaobao the src] # LS NodeJS / bin / 
Node NPM NPX 

[the root @tanbaobao the src] # Music Videos NodeJS / / usr / sbin /

Configuration software connection

[root@tanbaobao src]# ln -s /usr/sbin/nodejs/bin/node /usr/local/bin/
[root@tanbaobao src]# ln -s /usr/sbin/nodejs/bin/npm /usr/local/bin/

Check the installation:

[root@tanbaobao src]# node -v
v12.14.1
[root@tanbaobao src]# npm -version
6.13.4

Taobao mirrored configuration:

# After successful installation, cnpm executable file will be downloaded to nodejs installation directory (ie, / usr / sbin / nodejs / bin /) 
[root @ tanbaobao src] # npm install -g CNPM --registry = HTTPS: // registry.npm.taobao.org 

# configure global 
[root @ tanbaobao src] # LN -s / usr / sbin / nodejs / bin / cnpm / usr / local / bin / 

# View cnpm information 
[root @ tanbaobao src] # cnpm - V 
[email protected] (/ usr / sbin / NodeJS / lib / the node_modules / CNPM / lib / parse_argv.js) 
NPM @ 6.13.4 (/ usr / sbin / NodeJS / lib / the node_modules / CNPM / the node_modules / NPM / lib / npm.js) 
the Node @ 12.14.1 (/ usr / sbin / nodejs / bin / the Node) 
npminstall@3.25.2 (/usr/sbin/nodejs/lib/node_modules/cnpm/node_modules/npminstall/lib/index.js)
prefix=/usr/sbin/nodejs 
linux x64 3.10.0-957.21.3.el7.x86_64 
registry=https://r.npm.taobao.org

At this point, the installation is complete

Guess you like

Origin www.cnblogs.com/HeiDi-BoKe/p/12167901.html