我正在Heroku上通过我的GitHub部署react应用程序,但它显示错误

but5z9lq  于 2022-11-13  发布在  Git
关注(0)|答案(1)|浏览(119)
-----> Installing dependencies
       Installing node modules
       npm ERR! code EUSAGE
       npm ERR! 
       npm ERR! `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
       npm ERR! 
       npm ERR! Invalid: lock file's ajv@6.12.6 does not satisfy ajv@8.11.0
       npm ERR! Missing: ajv@6.12.6 from lock file
       npm ERR! Invalid: lock file's json-schema-traverse@0.4.1 does not satisfy json-schema-traverse@1.0.0
       npm ERR! Missing: ajv@6.12.6 from lock file
       npm ERR! Missing: typescript@4.8.4 from lock file
       npm ERR! Missing: ajv@6.12.6 from lock file
       npm ERR! Missing: ajv-keywords@3.5.2 from lock file
       npm ERR! Missing: json-schema-traverse@0.4.1 from lock file
       npm ERR! Missing: ajv@6.12.6 from lock file
       npm ERR! Missing: ajv-keywords@3.5.2 from lock file
       npm ERR! Missing: json-schema-traverse@0.4.1 from lock file
       npm ERR! Missing: json-schema-traverse@0.4.1 from lock file
       npm ERR! Missing: ajv@6.12.6 from lock file
       npm ERR! Missing: ajv-keywords@3.5.2 from lock file
       npm ERR! Missing: json-schema-traverse@0.4.1 from lock file
       npm ERR! Missing: json-schema-traverse@0.4.1 from lock file
       npm ERR! 
       npm ERR! Clean install a project
       npm ERR! 
       npm ERR! Usage:
       npm ERR! npm ci
       npm ERR! 
       npm ERR! Options:
       npm ERR! [--no-audit] [--foreground-scripts] [--ignore-scripts]
       npm ERR! [--script-shell <script-shell>]
       npm ERR! 
       npm ERR! aliases: clean-install, ic, install-clean, isntall-clean
       npm ERR! 
       npm ERR! Run "npm help ci" for more info
       
       npm ERR! A complete log of this run can be found in:
       npm ERR!     /tmp/npmcache.eeeVc/_logs/2022-10-08T16_54_25_418Z-debug-0.log
-----> Build failed
       
       We're sorry this build is failing! You can troubleshoot common issues here:
       https://devcenter.heroku.com/articles/troubleshooting-node-deploys
       
       If you're stuck, please submit a ticket so we can help:
       https://help.heroku.com/
       
       Love,
       Heroku
       
 !     Push rejected, failed to compile Node.js app.
 !     Push failed
mxg2im7a

mxg2im7a1#

最后,在做了大量的点击和测试之后,它现在可以工作了。我只是在.gitignore中添加了我的package-lock.json,并将其部署到Heroku,它工作得很好。

相关问题