nodejs安装

2024-10-09 08:46:07 浏览数 (2)

下载安装地址: https://nodejs.org/en/download/

查询安装系统: [root@VM-4-3-centos /]# uname Linux [root@VM-4-3-centos /]# uname -m x86_64 [root@VM-4-3-centos /]#

下载压缩包,https://nodejs.org/dist/v16.15.1/node-v16.15.1-linux-x64.tar.xz wget https://nodejs.org/dist/v16.15.1/node-v16.15.1-linux-x64.tar.xz

开始解压缩安装 [root@VM-4-3-centos local]# tar xvf node-v16.15.1-linux-x64.tar.xz [root@VM-4-3-centos local]# mv node-v16.15.1-linux-x64 nodejs [root@VM-4-3-centos nodejs]# cd ./bin [root@VM-4-3-centos bin]# ./node -v v16.15.1

目录 /usr/local/nodejs/bin

建立软连接,使其可以在全局被访问到: ln -s /usr/local/nodejs/bin/node /usr/local/bin/ ln -s /usr/local/nodejs/bin/npm /usr/local/bin/

[root@VM-4-3-centos /]# node -v v16.15.1 [root@VM-4-3-centos /]# npm -v 8.11.0

0 人点赞