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 有赏,i卡绘世画不出
    • ¥15 如何用stata画出文献中常见的安慰剂检验图
    • ¥15 c语言链表结构体数据插入
    • ¥40 使用MATLAB解答线性代数问题
    • ¥15 COCOS的问题COCOS的问题
    • ¥15 FPGA-SRIO初始化失败
    • ¥15 MapReduce实现倒排索引失败
    • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
    • ¥15 找一位技术过硬的游戏pj程序员
    • ¥15 matlab生成电测深三层曲线模型代码