Express腳手架搭建
1.DOC 執行 npm install -g express-generator 全局安裝express(只安裝一次就能夠)
![](http://static.javashuo.com/static/loading.gif)
2.打開終端/DOC窗口 進入項目文件夾執行 ------------------- express 項目名 ---------------------------
生成項目框架代碼
3.打開package.json查看依賴 打開終端進入項目目錄 安裝依賴 命令: npm install
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
4.啓動項目:
npm start 執行此命令, 會去package.json內尋找script 內的命令
![](http://static.javashuo.com/static/loading.gif)
自定義命令:
script 內添加 執行 npm run kkk
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
5.瀏覽器查看 (node 端口通常都是3000 端口)
![](http://static.javashuo.com/static/loading.gif)
歡迎關注本站公眾號,獲取更多信息