How to install templ in macos. Error:- templ not found

253 Views Asked by At

docs says.

  1. go install github.com/a-h/templ/cmd/templ@latest [This does not work.]

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

How Can I resolve it.

1

There are 1 best solutions below

1
TehSphinX On BEST ANSWER

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.