
7

Install GopherJS in Go Modules Mode
source link: http://siongui.github.io/2021/09/20/install-gopherjs-in-golang-modules-mode/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Install GopherJS in Go Modules Mode
September 20, 2021
Starting from Go 1.16, the module mode is on by default. You may heard that GOPATH is not needed in module mode, but if you want to install GopherJS, you still need to set it to build the GopherJS binary.
To install GopherJS, you need to set GOPATH environment variable first.
$ export GOPATH=/my/path/to/gopath
Then install GopherJS:
$ go get -u github.com/gopherjs/gopherjs
The executable GopherJS binary will be located in $(GOPATH)/bin, and remember to add this to your PATH variable.
Tested on: Ubuntu Linux 20.04, Go 1.17.1.
References:
[1]gopherjs: command not found · Issue #906 · gopherjs/gopherjs · GitHub
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK