Tag Archives: npm run eject

[Solved] React project NPM run error: npm ERR! errno 1

react project, execute NPM run eject to generate configuration file, and report error:

Remove untracked files, stash or commit any changes, and try again.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] eject: `react-scripts eject`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] 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

error reporting reason:

The scaffold adds a. Gitgnore file, but there is no local repository

solution:

cd  project
git init  // New codebase in current directory
git add .  // Add all files in the current directory to the staging area
git commit -m 'Saving before ejecting' // Commit the staging area to the repository area
npm run eject