惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
The GitHub Blog
The GitHub Blog
C
Check Point Blog
博客园_首页
MongoDB | Blog
MongoDB | Blog
N
Netflix TechBlog - Medium
F
Full Disclosure
Microsoft Security Blog
Microsoft Security Blog
爱范儿
爱范儿
Recent Announcements
Recent Announcements
阮一峰的网络日志
阮一峰的网络日志
G
GRAHAM CLULEY
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Threat Research - Cisco Blogs
C
Cybersecurity and Infrastructure Security Agency CISA
V
Vulnerabilities – Threatpost
K
Kaspersky official blog
博客园 - 司徒正美
S
Schneier on Security
T
The Exploit Database - CXSecurity.com
Project Zero
Project Zero
云风的 BLOG
云风的 BLOG
Cisco Talos Blog
Cisco Talos Blog
Know Your Adversary
Know Your Adversary
雷峰网
雷峰网
V
V2EX - 技术
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Spread Privacy
Spread Privacy
罗磊的独立博客
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
Security Affairs
SecWiki News
SecWiki News
Schneier on Security
Schneier on Security
O
OpenAI News
Jina AI
Jina AI
PCI Perspectives
PCI Perspectives
Cyberwarzone
Cyberwarzone
Y
Y Combinator Blog
Apple Machine Learning Research
Apple Machine Learning Research
B
Blog RSS Feed
I
InfoQ
D
Docker
P
Palo Alto Networks Blog
Recorded Future
Recorded Future
M
MIT News - Artificial intelligence
博客园 - Franky
B
Blog
Scott Helme
Scott Helme
博客园 - 叶小钗
D
DataBreaches.Net

博客园 - 滴水冰寒

阿里云linux--常用命令 electron桌面应用 wepack打包时出错不压缩代码及使用es7(async await)新语法问题 npm install 时发生错误 create-react-app 后使用babel/polyfill webpack3.x--react,jsx多页配置 webpack--打包scss webpack--打包和压缩css react--2.react-redux 百度智能语音引用1 vscode和gitee的使用 vue--1.环境搭建及创建项目 Python内置的服务器的使用 ionic3问题记录 ionic3自定义android原生插件 - 滴水冰寒 maven学习--1.项目结构及简单使用 maven学习--1.安装与配置 mybatis学习笔记1.零碎记录 - 滴水冰寒 mysql学习--1.事务
react--1.创建项目
滴水冰寒 · 2019-06-18 · via 博客园 - 滴水冰寒

1.环境node>=6,npm>=5.2

  npm5.2以后自带npx命令

2.npm install -g create-react-app   全局安装react环境

3.cd到存放项目的文件夹

   create-react-app my-app

   如果是npm5.2也可以省略第二步,直接执行 npx create-react-app my-app,如果此时没有全局安装过react环境,就会自动安装环境,再创建项目,过程会比较慢

   用npx安装时,尽量指定于node.js 匹配的版本,否则后续项目中安装其它依赖包时,可能会出现错误(现node.js版本过低)。

 4.执行 npm run eject (非必要)

  用 create-react-app创建项目后,默认webpack已经配置好了,如果想自行配置需执行npm run eject命令(是不可逆的),此时会把隐藏的配置文件暴露给我们。

5.cd到my-app目录

  npm start 运行项目