部署到heroku时如何解决Node和reactapp错误?

时间:2021-04-02 13:26:38

标签: node.js heroku package.json

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

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

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

1 个答案:

答案 0 :(得分:0)

首先检查和 npm 版本

$ node -v >> v16.2.0

$ npm -v >> 7.13.0

然后在引擎中检查您的服务器 package.json 更新相同的版本

enter image description here

如果不再使用,也删除 fsevent

并再次提交并推送 我希望它有帮助