美文网首页
react 开发环境搭建

react 开发环境搭建

作者: Java小工匠 | 来源:发表于2019-10-28 19:54 被阅读0次

1、安装NodeJS

http://nodejs.cn/download/

node -v
npm -v 

2、安装cnpm

cnpm 是npm的国内淘宝镜像

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

3、安装Yarn

安装yarn

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

配置Yarn 国内镜像

yarn config set registry https://registry.npm.taobao.org -g
yarn config set sass_binary_site http://cdn.npm.taobao.org/dist/node-sass -g

4、安装React脚手架

安装react脚手架

npm install -g create-react-app

创建demo工程

create-react-app  my-react1
image.png image.png

4、进入工程

cd my-react1
yarn start

5、效果展示

image.png

相关文章

网友评论

      本文标题:react 开发环境搭建

      本文链接:https://www.haomeiwen.com/subject/jkfivctx.html