亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何解決 running gcc failed exist status 1 in mac m1?

如何解決 running gcc failed exist status 1 in mac m1?

Go
MMMHUHU 2022-11-28 10:18:08
我已經 brew install mingw-w64。當我檢查它的版本時。gcc --版本:gcc (Homebrew GCC 11.2.0_3) 11.2.0.g++——版本:g++ (Homebrew GCC 11.2.0_3) 11.2.0我還運行哪個 gcc:/opt/homebrew/bin/gcc然后我用 image 運行我的 docker-compose golang:latest。還沒有錯誤up to date, audited 370 packages in 10m9 packages are looking for funding  run `npm fund` for details6 high severity vulnerabilitiesTo address issues that do not require attention, run:  npm audit fixTo address all issues (including breaking changes), run:  npm audit fix --forceRun `npm audit` for details.Unlinking stale socket /tmp/supervisor.sock[15:30:39] Using gulpfile /go/src/github.com/projectname/src/api/gulpfile.js[15:30:39] Starting 'default'...[15:30:39] Starting 'watch'...當我保存 .go 文件時,它會下載所有模組,這是錯誤: # github.com/projectname/api /usr/local/go/pkg/tool/linux_arm64/link: running gcc failed: exit status 1 collect2: fatal error: cannot find 'ld' compilation terminated. [15:46:23] 'build-binary' errored after 1.98 s [15:46:23] Error in plugin "gulp-shell" Message:     Command `go build` failed with exit code 2這是我的Dockerfile:FROM golang:1.17.0-alpine3.14 AS builder    RUN apk update && apk add gcc make git libc-dev binutils-gold# Install dependenciesRUN apk add --update tzdata \    --no-cache ca-certificates git wget \    nodejs npm \    g++ \    supervisor \    && update-ca-certificates \    && npm install -g gulp gulp-shellRUN npm install -g yarnCOPY ops/api/local/supervisor /etcENV PATH $PATH:/go/binWORKDIR /go/src/github.com/projectname/src/api
查看完整描述

1 回答

?
狐的傳說

TA貢獻1804條經驗 獲得超3個贊

嘗試并檢查是否像在這個 Dockerfile 中一樣,添加binutils-gold將允許您使用ld.

RUN apk update && apk add gcc make git libc-dev binutils-gold

(首次出現在nodejs/nodeissue 4212


查看完整回答
反對 回復 2022-11-28
  • 1 回答
  • 0 關注
  • 436 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號