react項目 npm run eject報錯


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

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

報錯原因:

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

解決辦法:

cd  project
git init  // 當前目錄新建代碼庫
git add .  // 添加當前目錄所有文件到暫存區
git commit -m 'Saving before ejecting'  // 提交暫存區到倉庫區
npm run eject

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM