Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu 18.04.2 LTS 安装 Node.js #74

Open
JasonWu73 opened this issue Feb 29, 2020 · 0 comments
Open

Ubuntu 18.04.2 LTS 安装 Node.js #74

JasonWu73 opened this issue Feb 29, 2020 · 0 comments
Labels
教程 基础入门
Projects

Comments

@JasonWu73
Copy link
Owner

JasonWu73 commented Feb 29, 2020

1、从 https://nodejs.org/en/download 下载 Linux Binaries,例如 node-v12.16.1-linux-x64.tar.xz

2、将 Linux Binaries 移动到 NodeJS 的安装目录,例如 /usr/local/nodejs(如果没有,则创建该目录)

3、进入 /usr/local/nodejs 目录,解压文件:

sudo tar txvf node-v10.1.0-linux-x64.tar.xz

4、修改目录所属的用户和用户组:

sudo chown -R wxj:wxj node-v12.16.1-linux-x64

5、设置环境变量:

code ~/.profile

在文件末尾添加以下内容:

# NodeJS
export NODEJS_HOME=/usr/local/nodejs/node-v12.16.1-linux-x64
export PATH=$NODEJS_HOME/bin:$PATH

6、刷新配置文件:

. ~/.profile

7、查看当前 Node.js 的版本:

node -v

7、查看当前 npm 的版本:

npm version
@JasonWu73 JasonWu73 added the 教程 基础入门 label Feb 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
教程 基础入门
Projects
Ubuntu
Awaiting triage
Development

No branches or pull requests

1 participant