运行“ npm运行弹出”时出错。错误“删除未跟踪的文件,存储或提交任何更改,然后重试。”。

Jus*_*ill 3 git npm reactjs npm-install

我尝试了很多方法来解决此错误。

命令:'npm run弹出'

Remove untracked files, stash or commit any changes, and try again.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! devportalfrontend@0.1.0 eject: `react-scripts eject`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the devportalfrontend@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!     /home/deep/.npm/_logs/2018-02-18T17_05_02_924Z-debug.log
Run Code Online (Sandbox Code Playgroud)

如何帮助解决这个问题。

Jus*_*ill 6

我已经尝试过以下命令了:

git add .
git commit -am "Save before ejecting"
Run Code Online (Sandbox Code Playgroud)

然后再试一次。


小智 6

卸载react-scripts和安装react-scripts-cssmodules解决了这个问题

npm uninstall react-scripts
Run Code Online (Sandbox Code Playgroud)

然后

npm install react-scripts-cssmodules
Run Code Online (Sandbox Code Playgroud)

然后

 npm run eject
Run Code Online (Sandbox Code Playgroud)


小智 5

您需要在运行弹出之前提交更改:

git add .
Run Code Online (Sandbox Code Playgroud)
git commit -am "change messages before running eject"
Run Code Online (Sandbox Code Playgroud)

现在,尝试一下

npm run eject
Run Code Online (Sandbox Code Playgroud)