一、npx
创建
-
创建
js
工程$ npx create-react-app demo
-
创建
ts
工程$ npx create-react-app demo --template typescript
二、npm
创建
-
全局安装
create-react-app
# 如果之前安装过,可先移除,保证最新版本 $ npm uninstall -g create-react-app # 安装 $ npm install -g create-react-app
-
创建
js
工程$ create-react-app demo
-
创建
ts
工程$ create-react-app demo --template typescript