docs says.
what I did. 1.
git clone https://github.com/a-h/templ.git [in /tmp]
cd cmd/templ && go install
still Error.
Solution I came up with. 1.
alias templ=$HOME/go/bin/templ [also added in ~/.zshrc]
why this does not work
go install github.com/a-h/templ/cmd/templ@latest
Edit:- I encountered this in windows too. Here are the steps I did to resolve this.
2. Extract it in $HOME/tmp and copy it.
3. Paste it in Folder where Golang is installed, i.e. Go/bin/[here].
In my case it was "C:\Program Files\Go\bin"
I found it using
which go
I also have this path configured in System Environment Variable.
go install
worked just fine as you can see from the alias you created. It only works because the installation was successful.
Add export PATH="$PATH:$HOME/go/bin"
to your ~/.zshrc
file to add Go's default installation folder to PATH
. That way all binaries that are installed with go install
will be available globally.