cnpm 使用 React 建立helloworld

 國內使用 npm 速度很慢,你可使用淘寶定製的 cnpm (gzip 壓縮支持) 命令行工具代替默認的 npm:react

 

$ npm install -g cnpm --registry=https://registry.npm.taobao.org $ npm config set registry https://registry.npm.taobao.org


這樣就可使用 cnpm 命令來安裝模塊了
$ cnpm install [name]

使用 create-react-app 快速構建 React 開發環境

create-react-app 自動建立的項目是基於 Webpack + ES6npm

$ cnpm install -g create-react-app $ create-react-app my_app $ cd my_app/ $ npm start


在瀏覽器中打開 http://localhost:3000
相關文章
相關標籤/搜索