【问题标题】:Unable to deploy to Heroku, no changes were made无法部署到 Heroku,未进行任何更改
【发布时间】:2020-07-19 23:54:40
【问题描述】:

我遇到了 Heroku 的部署问题。昨天,我能够毫无问题地进行部署——今天早上,我在 MongoDB 上构建了一个新集群,并使用新的连接字符串将更改推送到 git。没有进行其他更改。

推送到 git 后,我​​运行git push heroku master,并遇到以下错误:

. . .
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.
. . .

当然,我做的第一件事就是按照建议尝试运行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.

我已经调试了几个小时了,我似乎无法找到解决方案。

这里会发生什么?

【问题讨论】:

  • 不回答 OP 但您应该在环境变量中设置连接字符串

标签: javascript reactjs heroku


【解决方案1】:

尝试运行yarn add epoberezkin/fast-deep-equal

Yarn 似乎试图从错误的 github 存储库安装库。这可能是 Heroku 的错误消息没有告诉您正确的模块名称的错误。

【讨论】:

  • 这解决了这个错误消息,但是它抛出了另一个错误消息,could not locate module ./temp/..../index.js。我最终暂时摆脱了 simple-react-lightbox。
【解决方案2】:

在类似的情况下,当我尝试部署到 Heroku 时,我收到了相同的消息。在尝试了一些事情后(随机),我发现问题是 devDependencies。您宁愿将它们全部转移到正常依赖项:

npm install <module_name> --save-prod

这解决了我的错误,祝你好运!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-10-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-02-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多