微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在 HEROKU 上部署 MERN 应用程序时出错,节点和 npm 版本很好

如何解决在 HEROKU 上部署 MERN 应用程序时出错,节点和 npm 版本很好

这是使用 mongodb 数据库的日志文件 前端在根文件夹中,而后端在后端文件夹中。 请帮我解决这个错误


sh: 1: run: not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! login@0.1.0 heroku-postbuild: `NPM_CONfig_PRODUCTION=false npm install npm && run build`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the login@0.1.0 heroku-postbuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /tmp/npmcache.rKjZV/_logs/2021-06-17T18_12_28_684Z-debug.log
-----> Build Failed
       
       We're sorry this build is failing! You can troubleshoot common issues here:
       https://devcenter.heroku.com/articles/troubleshooting-node-deploys
       
       If you're stuck,please submit a ticket so we can help:
       https://help.heroku.com/
       
       love,Heroku
       
 !     Push rejected,Failed to compile Node.js app.
 !     Push Failed

```

解决方法

shell 脚本 const updateSearchText = (e) => { history.push("/search"); }; . . . <button className="btn btn-outline-light" onClick={updateSearchText} onChange={setSearchText} > 相当于:

  • df$binary <- ifelse(df$chance.of.admit>0.5,1,0)
  • NPM_CONFIG_PRODUCTION=false npm install npm && run build
  • NPM_CONFIG_PRODUCTION=false

我假设您打算运行 npm install npm,为此您需要将 run build 设置为:npm run build。请注意在 heroku-postbuild 之后添加的 NPM_CONFIG_PRODUCTION=false npm install npm && npm run build

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。