美文网首页React
使用从create-react-app创建项目后,运行npm r

使用从create-react-app创建项目后,运行npm r

作者: 追逐_e6cf | 来源:发表于2018-11-01 12:06 被阅读0次

    使用create-react-app命令创建一个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! test@0.1.0 eject: `react-scripts eject`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the test@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!     C:\Users\lenovo\AppData\Roaming\npm-cache\_logs\2018-11-01T04_03_50_129Z-debug.log
    

    主要问题是脚手架添加.gitgnore文件,但是却没有本地仓库,按照以下顺序就可以正常使用

    create-react-app test
    cd test
    git init
    git add .
    git commit -m 'Saving before ejecting'
    npm run eject
    

    相关文章

      网友评论

        本文标题:使用从create-react-app创建项目后,运行npm r

        本文链接:https://www.haomeiwen.com/subject/jqatxqtx.html