【问题标题】:heroku push rejected for a reactappheroku push 拒绝了一个反应应用程序
【发布时间】:2021-04-24 09:52:53
【问题描述】:

我正在尝试在 Heroku 上推送存储库,但收到以下错误消息:

remote: npm ERR! code EBADPLATFORM
remote: npm ERR! notsup Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
remote: npm ERR! notsup Valid OS:    darwin
remote: npm ERR! notsup Valid Arch:  any
remote: npm ERR! notsup Actual OS:   linux
remote: npm ERR! notsup Actual Arch: x64
remote: 
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR!     /tmp/npmcache.FM9ZL/_logs/2021-03-22T20_17_38_119Z-debug.log
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 1
remote: npm ERR! backend@0.0.0 heroku-postbuild: `cd moodzle && npm install && npm run build`
remote: npm ERR! Exit status 1
remote: npm ERR! 
remote: npm ERR! Failed at the backend@0.0.0 heroku-postbuild script.
remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
remote: 
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR!     /tmp/npmcache.FM9ZL/_logs/2021-03-22T20_17_38_183Z-debug.log
remote: 
remote: -----> Build failed
remote:        
remote:        We're sorry this build is failing! You can troubleshoot common issues here:
remote:        https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:        
remote:        Some possible problems:
remote:        
remote:        - Node version not specified in package.json
remote:          https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-versio
remote:        
remote:        Love,
remote:        Heroku
remote:        
remote:  !     Push rejected, failed to compile Node.js app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !       Push rejected to blooming-hamlet-25452.
remote: 

我在 React 中的前端名为“moodzle”,位于我的后端项目中。

在我 Back 的包 Json 中,我写道:

"scripts": {
    "start": "node ./bin/www",
    "heroku-postbuild": "cd moodzle && npm install && npm run build"
  },

在我的 app.js 中:app.use(express.static(path.join(__dirname, "moodzle/build")));

你能帮帮我吗?

谢谢!

瑞奇!

【问题讨论】:

    标签: node.js reactjs linux heroku


    【解决方案1】:

    为遇到问题的人编辑:

    我不得不删除我的包锁定 json(但你可以将它添加到 .gitignore),因为它在 github 中的小组工作后有“windows 剩余”,但我在 linux 上,所以 Heroku 丢失了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-03-08
      • 1970-01-01
      • 2014-06-07
      • 2019-10-25
      • 2013-05-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多