duandanai6470 2019-06-14 15:44
浏览 47

/ bin / sh:1:转到:推送到heroku时找不到

I'm trying to use React Frontend and Go Backend language.

I have to Go installed locally and I can run commands like go run main.go or go build. But when I try to push to Heroku, I get the following error:

$ rm -rf index && go build -o index
remote: /bin/sh: 1: go: not found
remote: error Command failed with exit code 127.
remote:        info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
remote: error Command failed with exit code 127.
remote:        info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
remote:
remote: -----> Build failed

This is my package.json:

{
  "name": "fullstack-course",
  "version": "1.0.0",
  "description": "",
  "main": "index.go",
  "scripts": {
    "client": "rm -rf build/ && webpack --env.mode production",
    "server": "rm -rf index && go build -o index",
    "start": "./index",
    "heroku-postbuild": "yarn run client && yarn run server"
  },
  "engines": {
    "node": "10.x",
    "npm": "6.9.x",
    "yarn": "1.x"
  },
  "repository": {
    "type": "git",
  },
  "author": "",
  "license": "ISC",
  "dependencies": {...}
}

Why when running locally it works, but when pushing it to Heroku it fails?

How can I fix this?

Thanks

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 对于相关问题的求解与代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作
    • ¥15 求NPF226060磁芯的详细资料
    • ¥15 使用R语言marginaleffects包进行边际效应图绘制