react安装篇

来源:互联网 发布:5355端口 编辑:程序博客网 时间:2024/06/06 01:14

1.首先安装npm
我是直接安装nodejs就会自动安装了的,环境是mac

portal git:(master) ✗ node -v    v6.11.0portal git:(master) ✗ npm -v3.10.10

你也可以手动安装参考这里
2.接下来 就可以安装react了,详情请参考官网

npm install -g create-react-appcreate-react-app my-appcd my-appnpm start

之后会自动打开浏览器http://localhost:3000/
在终端也会显示以下内容

Compiled successfully!You can now view my-app in the browser.  Local:            http://localhost:3000/  On Your Network:  http://192.168.1.101:3000/Note that the development build is not optimized.To create a production build, use npm run build.

要了解更多,请移步官网

原创粉丝点击