1. 程式人生 > >安裝React基本執行環境

安裝React基本執行環境

準備工作

  • 安裝node.js:
      官網下載node.js穩定版本,並進行安裝nodejs官網

  • 安裝cnpm代替npm:
      npm install -g cnpm --registry=https://registry.npm.taobao.org

  • 安裝create-react-app
      安裝create-react-app有利於我們快速建立一個react應用,安裝命令: cnpm install -g create-react-app

  • 建立專案
      進入到你想建立專案的路徑,建立專案 create-react-app myapp;建立時間比較長,建立成功後,呼叫npm start myapp執行專案,瀏覽器 localhost:13000進行檢視。