React-----学习笔记-----React基本环境安装(二)

  • 安装node.js,到node.js官网下载对应的安装包安装好环境;
  • 安装create-react-app
$npm install -g create-react-app
  • 这条命令会在我们的电脑上安装一条叫create-react-app的命令,安装完成后可以使用它来构建一个react的前端工程:
$create-react-app my-react
Success! Created my-react at D:\workSpace\my-react
Inside that directory, you can run several commands:

  npm start
    Starts the development server.

  npm run build
    Bundles the app into static files for production.

  npm test
    Starts the test runner.

  npm run eject
    Removes this tool and copies build dependencies, configuration files
    and scripts into the app directory. If you do this, you can’t go back!

We suggest that you begin by typing:

  cd my-react
  npm start

Happy hacking!
  • 这条命令会帮我们构建一个叫my-react的工程,并自动安装我们所需要的依赖
  • 安装完成后启动工程
$cd my-app
$npm start 
  • 终端提示成功并会自动打开浏览器展示运行效果:
npm start

> my-react@0.1.0 start D:\workSpace\my-react
> react-scripts start
Starting the development server...
Compiled successfully!

You can now view my-react in the browser.

  Local:            http://localhost:3000/
  On Your Network:  http://192.168.31.241:3000/

Note that the development build is not optimized.
To create a production build, use npm run build.

react

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值