# 安裝與開始

## 安裝資源

* 安裝 node : [node安裝](https://nodejs.org/en/)
* 選擇 LTS(Long Term Support)版本 :因資源與討論較多
* 安裝完可以用 : node -v 與 npm -v (或--version)觀看版本,也可確定安裝成功

## 開始專案

* 建立專案資料夾
* 使用 cmd 進入 : cd 你的路徑
* 使用 npm init 做出 package.json (方便管理模組 與 執行)
* 安裝 nodemon 以方便執行,當檔案進行更改,會自動更新 : npm install nodemon -g
  * -g : 代表安裝在電腦內部,可在任一資料夾執行
  * -save : 安裝在本專案資料夾內
  * -save-dev : 安裝在本專案資料夾內用於測試或輔助
* 版本說明 :&#x20;
  * 在 package.json 會看到:

    ```
    "dependencies": {
      "body-parser": "^1.18.3",
      "ejs-locals": "^1.0.2",
      "express": "^4.16.3"
    }
    ```
  * 說明 :&#x20;

![](https://2671156273-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LaDZjNzr08eW9hIl-Qq%2F-LaDdqw_bCggxv6Z-pv8%2F-LaDdvY7U14dQhuY-72k%2FnodeVersionDescription.png?generation=1552876561000758\&alt=media)

* 恭喜完成開始專案

## express-generator

* 用意 : 更加快速產生express專案
* 請參考 express 官網 : <http://expressjs.com/zh-tw/starter/generator.html>


---

# 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://learnprogramming.gitbook.io/programlearned/node/begin.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.
