【发布时间】: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