nodejs+react構建仿知乎的小Demo

1、命令行進入指定項目文件夾node

2、相關命令安裝環境和項目工具react

1 npm init
2 
3 npm install react -- save
4 
5 npm install -g gulp
6 
7  npm install --save-dev gulp gulp-browserify gulp-concat gulp-react gulp-connect lodash reactify 

安裝好了以後打開項目會多出node_modules文件夾和package.json文件以及package-lock.json文件,其中package.json文件內容以下:npm

{
  "name": "reactzh",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "gulp": "^3.9.1",
    "gulp-browserify": "^0.5.1",
    "gulp-concat": "^2.6.1",
    "gulp-connect": "^5.0.0",
    "gulp-react": "^3.1.0",
    "lodash": "^4.17.4",
    "reactify": "^1.1.1"
  }
}

3、安裝bowerjson

Bower是一個客戶端技術的軟件包管理器,它可用於搜索、安裝和卸載如JavaScript、HTML、CSS之類的網絡資源。其餘一些創建在Bower基礎之上的開發工具,如YeoMan和Grunt。gulp

npm install -g bower

 

bower init

 

bower install bootstrap  --save
相關文章
相關標籤/搜索