LoginSignup
0
1

More than 3 years have passed since last update.

VS Code上でGolangのパッケージをインストールする時にでたエラーを解決した

Posted at

環境

  • windows 10
  • Golang 1.12.9
  • VS Code # 問題 VS Code上でGolangのパッケージをインストールする時に、表示されたエラーは以下。
//一部分のみ記載
Installing 16 tools at C:\Users\~\go\bin


  gocode

Installing github.com/mdempsky/gocode FAILED

16 tools failed to install.

gocode:
Error: Command failed: C:\Program Files\Go\bin\go.exe get -u -v github.com/mdempsky/gocode
github.com/mdempsky/gocode (download)
go: missing Git command. See https://golang.org/s/gogetcmd
package github.com/mdempsky/gocode: exec: "git": executable file not found in %PATH%
github.com/mdempsky/gocode (download)
go: missing Git command. See https://golang.org/s/gogetcmd
package github.com/mdempsky/gocode: exec: "git": executable file not found in %PATH%

解決策

エラーメッセージを読むと、

  • Gitがインストールされていない
  • GitのPATHが通っていない

いずれかが問題であるらしいので、コマンドプロンプトを開いて確認。

git --version

gitはインストールしてあるが認識しなかったので、PATHを通す。

Golangのパッケージのインストールを再度試し、以下の表示がでた。

All tools successfully installed. You're ready to Go :).

以上で、正常にインストールが完了した。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1