admin管理员组

文章数量:1642338

create-react-app命令创建一个react项目,运行npm run eject生成配置文件,报了下面的错:

NOTE: Create React App 2+ supports TypeScript, Sass, CSS Modules and more without ejecting: https://reactjs/blog/2018/10/01/create-react-app-v2.html

√ Are you sure you want to eject? This action is permanent. ... yes
This git repository has untracked files or uncommitted changes:

主要问题是脚手架添加.gitgnore文件,但是却没有本地仓库,按照以下顺序就可以正常使用:

create-react-app app-demo
cd app-demo
git init
git add .
git commit -m 'Saving before ejecting'
npm run eject

 

本文标签: 报错解决方法项目Reactapp