创建react项目

62 阅读1分钟

有两种方式可以创建react项目

官方

npx create-react-app my-app

注意:使用npx前需要先升级npm,不然会出现:no such file or directory, lstat 'C:\Users\xxx\AppData\Roaming\npm' 和 enoent This is related to npm not being able to find a file. 的错误

升级npm

npm i -g npm@latest

vite

npm create vite@latest

糟点:在git bash中无法使用方向键来选择,有时候输入数字也无法选择