# 命令提示字元 ## 指定檔案位置 | 指令 | 說明| 範例| | --------- | -------- | ---------| | cd | 前往到資料夾 | **cd** C:\Users\user>cd C:\Users\user\Desktop\test (可直接cd 後面網址拖曳)| |cd ..|回到上一層|C:\Users\user\Desktop\緯育\bs5_example>**cd ..**| |dir|瀏覽所在目錄(win)|C:\Users\user\Desktop\緯育\bs5_example>**dir**| |ls|瀏覽所在目錄(mac)| | |node --version|查看安裝版本號|成功回傳: Welcome to Node.js v18.18.1.| |CTRL+C|跳出環境|成功回到 C:\Users\user>| |mkdir|創建資料夾目錄|新增src\routes目錄: C:\workspace\TWM\practice\reactRouterPractice>**mkdir** src\routes| |touch|新增檔案|C:\workspace\TWM\practice\reactRouterPractice>**touch** src/routes/root.jsx| ## git常用 | 指令 | 說明 | example | | ----------- | ------------------------ | -------------- | | git init | 開始使用數據庫,會建立repository(出現隱藏的.git檔案在資料夾中) | | | git --vision | git是否安裝成功,成功會有版本 | 成功回傳: git version 2.41.0.windows.1| |git config --global user.name "姓名" |設定輸入姓名| | |git config --global user.email "信箱"|輸入個人的 email|| |git config –list |查詢 git 設定內容(查詢姓名email等)|| |git status|查詢當前檔案狀態,可查看staging area的檔案|若當前有資料被追蹤會顯示| |git add .|新增檔案到索引區(staging area)|| |git commit -m "這邊輸入更新說明"|將資料commit到本地數據庫(repository)|成功會回傳更新內容| |git log|顯示commit次數與說明,要退出輸入 q|| |git push -u origin master|更新commit到數據庫中(指令會隨角色改變)|| ## node常用 | 指令 | 說明 | example | | -------------- | ------------------------ | -------------- | | cd | 指向資料夾 | C:\Users\user\Desktop\project\test>cd node.js | | node js檔案名稱 | 透過node執行js | C:\Users\user\Desktop\project\test\node.js>node all.js | ### node.js-npm | 指令 | 說明 | | -------- | -------- | | npm -v | 觀看 NPM 版本 | | npm -init | 新增 package.json | | npm install [模組名稱][安裝位置] | 安裝 NPM 模組,安裝位置常用屬性如下 | | npm install [模組名稱] --g | 全域安裝 | | npm install [模組名稱] --save | 安裝模組並寫入 package.json 的 "dependencies" | | npm install [模組名稱] --save-dev | 安裝模組並寫入 package.json 的 "devDependencies" | |npm list | 顯示安裝的 NPM 列表 | |npm uninstall [模組名稱] | 刪除專案裡的 NPM | |[專案名稱]>npm run dev|開發環境|
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up