【问题标题】:How to solve Node and reactapp error when deploying to heroku?部署到heroku时如何解决Node和reactapp错误?
【发布时间】:2021-06-29 08:49:00
【问题描述】:

我正在尝试部署我的节点并响应 Web 应用程序。我已经完成了部署的所有步骤。但是当我运行这个命令时,git push heroku main。一切顺利到这里
,并且所有的依赖都安装好了,然后出现错误,

remote:        > NPM_CONFIG_PRODUCTION=false npm install --prefix frontend && npm 
run build --prefix frontend
remote:
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

问题是我的package.json 文件中甚至没有fsevents。而且错误清楚地表明 fsevents 需要 linux in os 但问题是在哪里编辑它
有什么帮助吗?

【问题讨论】:

  • 你有试过在push之前安装fsevents吗? npm install fsevents --save
  • 不,我没有这样做

标签: node.js heroku package.json


【解决方案1】:

首先检查和 npm 版本

$节点-v >> v16.2.0

$ npm -v >> 7.13.0

然后检查你的服务器 package.json 里面引擎更新相同的版本像这样

enter image description here

如果不再使用,也删除 fsevent

并再次提交并推送 希望对你有帮助

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-01-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-12
    • 2021-10-11
    • 2019-04-17
    相关资源
    最近更新 更多