# 安裝nodejs環境

## Linux 上安裝Node.js

### 一行指令安裝

```
curl -sL https://deb.nodesource.com/setup_12.x | bash -
```

### 直接使用已編譯好的包

Node 官網已經把linux 下載版本更改為已編譯好的版本了，我們可以直接下載解壓後使用：

![](/files/-LsPFtWGxhhWW5K49qA3)

wget <https://nodejs.org/dist/v12.13.0/node-v12.13.0-linux-x64.tar.xz>

```
tar xvf node-v12.13.0-linux-x64.tar.xz
cd node-v12.13.0-linux-x64/
ln -s /root/node-v12.13.0-linux-x64/bin/node /usr/local/bin/
ln -s /root/node-v12.13.0-linux-x64/bin/npm /usr/local/bin/
```

#### node -v

#### npm -v


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kawsing.gitbook.io/opensystem/andoid-shou-ji/untitled-4/an-zhuang-nodejs-huan-jing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
