Javascript 无法部署到Heroku,未进行任何更改
我遇到了Heroku的部署问题。昨天,我能够毫无问题地进行部署——今天早上,我在MongoDB上构建了一个新集群,并使用新的连接字符串对git进行了更改。没有进行其他更改 推到git后,我运行了git push heroku master,遇到以下错误:Javascript 无法部署到Heroku,未进行任何更改,javascript,reactjs,heroku,Javascript,Reactjs,Heroku,我遇到了Heroku的部署问题。昨天,我能够毫无问题地进行部署——今天早上,我在MongoDB上构建了一个新集群,并使用新的连接字符串对git进行了更改。没有进行其他更改 推到git后,我运行了git push heroku master,遇到以下错误: . . . remote: added 1812 packages from 857 contributors and audited 932744 packages in 66.192s remote: remo
. . .
remote: added 1812 packages from 857 contributors and audited 932744 packages in 66.192s
remote:
remote: 65 packages are looking for funding
remote: run `npm fund` for details
remote:
remote: found 0 vulnerabilities
remote:
remote:
remote: > client@0.1.0 build /tmp/build_3fd8925946ec2800b115594ca20fb426/client
remote: > react-scripts build
remote:
remote: Creating an optimized production build...
remote: Failed to compile.
remote:
remote: ./node_modules/simple-react-lightbox/dist/index.es.js
remote: Cannot find module: 'fast-deep-equal/react'. Make sure this package is installed.
remote:
remote: You can install this package by running: yarn add fast-deep-equal/react.
. . .
当然,我做的第一件事就是尝试按照建议运行纱线添加快速深度相等/反应
,这会引发下一个错误
error Command failed.
Exit code: 128
Command: git
Arguments: ls-remote --tags --heads ssh://git@github.com/fast-deep-equal/react.git
Directory: /Users/me/my-app
Output:
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
我已经调试了好几个小时了,但似乎找不到解决方案
这里会发生什么?试着运行
纱线添加epoberezkin/fast deep equal
Thread似乎试图从错误的github存储库安装库。这可能是因为Heroku的错误消息没有告诉您正确的模块名称。在类似的情况下,当我尝试部署到Heroku时,我收到了相同的消息。在尝试了一些事情(随机)后,我发现问题在于依赖性。您更愿意将它们全部转移到普通依赖项:
npm install <module_name> --save-prod
npm安装--保存产品
这解决了我的错误,祝你好运 不回答OP,但您应该在环境变量中设置连接字符串这解决了此错误消息,但它引发了另一个错误消息,
无法定位模块。/temp/…/index.js
。我最终摆脱了simple react灯箱。