创建React16项目

本文介绍了如何通过npm全局安装create-react-app,然后使用它来创建一个React项目。创建过程中提到了项目名称不能使用大写字母,并可以选择typescript模板。创建成功后,可以运行几个关键命令,如启动开发服务器、打包生产文件、运行测试和 eject 以获取更深度的项目控制。建议初学者从运行项目并启动开发服务器开始。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

安装

npm install -g create-react-app

创建项目

项目名称不能大写

create-react-app 项目名称
// 创建ts版
create-react-app 项目名称 --template typescript

创建完成

yarn 或 npm run

Success! Created react007 at /Users/fanis/test/react/react007
Inside that directory, you can run several commands:

  yarn start
    Starts the development server.

  yarn build
    Bundles the app into static files for production.

  yarn test
    Starts the test runner.

  yarn 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 react007
  yarn start

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值