react 环境搭建

  1:需要给系统装一个node  https://nodejs.org/zh-cn/

  2:然后需要到cmd安装一个淘宝镜像 (在cmd上面执行):

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



3:安装react
4:
新建一个文件夹(作为项目文件夹),shift+右键 在该文件夹中打开命令窗口

使用 create-react-app 快速构建 React 开发环境

create-react-app 是来自于 Facebook,通过该命令我们无需配置就能快速构建 React 开发环境。

create-react-app 自动创建的项目是基于 Webpack + ES6 。

执行以下命令创建项目:

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

--------------------
安装yarn
 控制台上输入:npm install -g yarn react-native-cli 
                         yarn config set registry https://registry.npm.taobao.org --global
                         yarn config set disturl https://npm.taobao.org/dist --global 
 
文件目录中 的控制台 (shift+右键(在此处打开命令窗口))安装依赖包: yarn install
 
启动程序 :npm run dev
 
 
 
 
 




posted @ 2018-10-10 10:21  wonderfulviews  阅读(136)  评论(0编辑  收藏  举报