Error with run "npm run eject". Error 'Remove untracked files, stash or commit any changes, and try again.'

I have tried this command it's worked:

git add .
git commit -am "Save before ejecting"

and then try again.


Uninstalling react-scripts and installing react-scripts-cssmodules solved the problem

npm uninstall react-scripts

And then

npm install react-scripts-cssmodules

then

 npm run eject

Add it the git changes

git add .
git commit -am "Save before ejecting"

This says in the message that you have untracked files that means that they are not being monitored by your VCS. Hence add and commit them before you eject.

If you are using Visual Studio Code:

  • Just click on the third icon (Source Control), below the magnifying glass button
  • Then click on the tick mark, if it asks to automatically stage your changes Click Yes
  • Add your commit message and then you are done

enter image description here

Try ejecting again,

npm run eject

Should work just fine. Happy Hacking!