NodeJS

安裝方法

`https://github.com/nvm-sh/nvm#install--update-script

$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash

# 確認自己用的 shell 是哪一種後,修改相對應的設定檔

$ echo $0

# 根據 echo $0 的結果,下方選擇一個來確認

$ cat ~/.zshrc $ cat ~/.bashrc

# 關掉 terminal 重新啟動

$ nvm -v`

start with NodeJS

  1. 在 github 上建立一個 hello-node 專案,勾選建立 readme

  2. 找到自己這個專案的 url,在 home 目錄下 clone 這個專案

    # 在資料夾中建立 hello-node $ git clone <https://github.com/wen1011/hello-node.git>

  3. 用 vscode 開啟這個專案,在專案內建立 檔案夾

  4. 在 檔案夾 內建立 js

  5. 測試結果

`$ cd practice $ node sum.js

# 如果不切換

$ node practice/sum.js`