programlearned
  • Introduction
  • js 筆記
    • Hammer.js 應用
  • node 筆記
    • 安裝與開始
    • exports 的應用
    • http 模組知識
    • Express 開始
      • 載入靜態檔案(image,css,js)
      • ejs 的使用
      • ejs layout的使用
      • ejs include的使用
      • ejs-form 的使用
      • ejs-ajax 的使用
      • route 的整理使用
    • 參考資料
  • vue 筆記
    • 安裝與開始
    • 基礎知識
      • 創建vue與輸出
      • v-bind 綁訂應用
      • v-for 與 v-if
      • v-on
      • v-class
      • 計算功能函數
      • 表單資料綁定
      • TodoList製作
    • 參考資料
  • Bootstrap 筆記
    • 相關資源網站
    • 安裝與開始
    • CSS 基礎知識
    • 容器container 應用
    • 網格系統 應用
      • 斷點
      • 版本斷點比較
      • 欄位排序
      • 欄位推移
      • 巢狀欄位
      • Flexbox 方向性
    • 間隔工具
    • 按鈕(button)
    • 不同的呈現(display)方式
    • 容器對齊方式
    • 文字(背景顏色)對齊與樣式
    • 導覽列應用
    • 參考資源
  • gitbook 製作與離線版
Powered by GitBook
On this page
  • 安裝資源
  • 開始專案
  • express-generator

Was this helpful?

  1. node 筆記

安裝與開始

Previousnode 筆記Nextexports 的應用

Last updated 6 years ago

Was this helpful?

安裝資源

  • 安裝 node :

  • 選擇 LTS(Long Term Support)版本 :因資源與討論較多

  • 安裝完可以用 : node -v 與 npm -v (或--version)觀看版本,也可確定安裝成功

開始專案

  • 建立專案資料夾

  • 使用 cmd 進入 : cd 你的路徑

  • 使用 npm init 做出 package.json (方便管理模組 與 執行)

  • 安裝 nodemon 以方便執行,當檔案進行更改,會自動更新 : npm install nodemon -g

    • -g : 代表安裝在電腦內部,可在任一資料夾執行

    • -save : 安裝在本專案資料夾內

    • -save-dev : 安裝在本專案資料夾內用於測試或輔助

  • 版本說明 :

    • 在 package.json 會看到:

      "dependencies": {
        "body-parser": "^1.18.3",
        "ejs-locals": "^1.0.2",
        "express": "^4.16.3"
      }
    • 說明 :

  • 恭喜完成開始專案

express-generator

  • 用意 : 更加快速產生express專案

請參考 express 官網 :

node安裝
http://expressjs.com/zh-tw/starter/generator.html