react項目 npm run eject報錯

react項目,執行npm run eject生成配置文件報錯:react

Remove untracked files, stash or commit any changes, and try again.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! xindai-3@0.1.0 eject: `react-scripts eject`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the xindai-3@0.1.0 eject script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/fengyang/.npm/_logs/2018-12-26T08_28_06_453Z-debug.log

報錯緣由:git

腳手架添加.gitgnore文件,可是卻沒有本地倉庫。npm

解決辦法:this

cd  project
git init  // 當前目錄新建代碼庫
git add .  // 添加當前目錄全部文件到暫存區
git commit -m 'Saving before ejecting'  // 提交暫存區到倉庫區
npm run eject
相關文章
相關標籤/搜索