Wiki.js 安装 需要用到nodejs,本文介绍下快速安装nodejs
环境:
操作系统:CentOS7.6
nodejs版本:10.16.3
打开官网,使用最新版本的nodejs,官网会自动匹配你系统版本的nodejs,这里主要介绍在Linux系统下面安装nodejs,我们选择Other Downloads,如下图:
在新的页面选择Linux Binaries,如下图:
安装配置方法如下:
[root@k8s-server01 opt]# wget https://nodejs.org/dist/v10.16.3/node-v10.16.3-linux-x64.tar.xz --2019-08-29 10:16:21-- https://nodejs.org/dist/v10.16.3/node-v10.16.3-linux-x64.tar.xz Connecting to 10.86.87.60:3128... connected. Proxy request sent, awaiting response... 200 OK Length: 13040896 (12M) [application/x-xz] Saving to: ‘node-v10.16.3-linux-x64.tar.xz’ 100%[============================================================================================================================================>] 13,040,896 6.72MB/s in 1.8s 2019-08-29 10:16:24 (6.72 MB/s) - ‘node-v10.16.3-linux-x64.tar.xz’ saved [13040896/13040896] [root@k8s-server01 opt]# xz -d node-v10.16.3-linux-x64.tar.xz [root@k8s-server01 opt]# ll -rw-r--r-- 1 root root 67143680 Aug 16 02:52 node-v10.16.3-linux-x64.tar [root@k8s-server01 opt]# tar xf node-v10.16.3-linux-x64.tar [root@k8s-server01 opt]# ll drwxrwxr-x 6 500 500 108 Aug 16 02:51 node-v10.16.3-linux-x64 [root@k8s-server01 opt]# mv node-v10.16.3-linux-x64 nodejs [root@k8s-server01 opt]# ll drwxrwxr-x 6 500 500 108 Aug 16 02:51 nodejs [root@k8s-server01 opt]# ln -sv /opt/nodejs/bin/npm /usr/local/bin/ ‘/usr/local/bin/npm’ -> ‘/opt/nodejs/bin/npm’ [root@k8s-server01 opt]# ll /usr/local/bin/ total 0 lrwxrwxrwx 1 root root 19 Aug 29 10:18 npm -> /opt/nodejs/bin/npm [root@k8s-server01 opt]# ln -sv /opt/nodejs/bin/node /usr/local/bin/ ‘/usr/local/bin/node’ -> ‘/opt/nodejs/bin/node’ [root@k8s-server01 opt]# ll /usr/local/bin/ total 0 lrwxrwxrwx 1 root root 20 Aug 29 10:18 node -> /opt/nodejs/bin/node lrwxrwxrwx 1 root root 19 Aug 29 10:18 npm -> /opt/nodejs/bin/npm
查看确认安装的版本:
[root@k8s-server01 opt]# node -v v10.16.3
至此安装完成Nodejs安装。