bud icon indicating copy to clipboard operation
bud copied to clipboard

`bud run` gives me -mod=mod not supported (can be '', 'readonly', or 'vendor')

Open Bishwas-py opened this issue 3 years ago • 7 comments

I am very new to bud, I am an indie dev. And was trying out bud, but bun run give me : -mod=mod not supported (can be '', 'readonly', or 'vendor')

This is my path tree:

├── bud
├── go.mod
├── go.sum
├── node_modules
├── package.json
└── package-lock.json

Bishwas-py avatar Aug 04 '22 08:08 Bishwas-py

With sudo privilege:

root@my-uname:/home/my-uname/Projects/go-for-good/bud-learning# bud run
| Listening on http://127.0.0.1:3000
| conjure: generate "bud/internal/app/main.go". app: unable to load state: app: unable to wire. di: unable to wire "bud-learning/bud/program".loadWeb function. di: unable to find definition for param "github.com/livebud/bud/package/router".*Router in "bud-learning/bud/internal/app/web".*Server . parser: unable to find declaration for "github.com/livebud/bud/package/router".Router in "bud/internal/app/web/web.go". stat /root/go/pkg/mod/github.com/livebud/[email protected]: no such file or directory

Bishwas-py avatar Aug 04 '22 08:08 Bishwas-py

I install bud with

curl -sf https://raw.githubusercontent.com/livebud/bud/main/install.sh | sh

Bishwas-py avatar Aug 04 '22 08:08 Bishwas-py

Hi @Bishwas-py, that's interesting.

  • What version of Go are you running?
  • What are the permissions of go-for-good?

but bun run give me : -mod=mod not supported (can be '', 'readonly', or 'vendor')

Do you mean bud create? It seems like bud run is giving you no such file or directory which makes sense if bud create didn't have the right permissions.

matthewmueller avatar Aug 05 '22 22:08 matthewmueller

What version of Go are you running?

go version go1.13.8 linux/amd64

What are the permissions of go-for-good?

drwxrwxr-x  4 codie codie    4096 Aug  4 14:04  go-for-good

The permission of file inside go-for-good/bud-learning

codie@codes-codie:~/Projects/go-for-good/bud-learning$ ls -la
total 48
drwxrwxr-x 4 codie codie 4096 Aug  4 15:10 .
drwxrwxr-x 4 codie codie 4096 Aug  4 14:04 ..
drwxrwxr-x 3 codie codie 4096 Aug  4 15:10 bud
-rw-r--r-- 1 codie codie   19 Aug  4 15:07 .gitignore
-rw-rw-r-- 1 codie codie   90 Aug  4 15:07 go.mod
-rw-rw-r-- 1 codie codie 8953 Aug  4 15:07 go.sum
drwxrwxr-x 2 codie codie 4096 Aug  4 15:10 .idea
-rw-r--r-- 1 codie codie  108 Aug  4 15:07 package.json
-rw-rw-r-- 1 codie codie 4835 Aug  4 15:10 package-lock.json

Bishwas-py avatar Aug 06 '22 01:08 Bishwas-py

@matthewmueller Do you mean bud create? It seems like bud run is giving you no such file or directory which makes sense if bud create didn't have the right permissions.

Yeah, bud run is giving me issues.

Bishwas-py avatar Aug 06 '22 01:08 Bishwas-py

Hey @matthewmueller, I succefully used bud run after updating it to go version go1.19 linux/amd64. While updating I had to do it via external ways.

sudo apt-get purge golang*
sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt update
sudo apt install golang-go

But I dunno if this is a proper solution but it work for my user, wherever it give this weird error for my root.

root@codes-codie:/home/<path-to-project>/go-for-good/bud-learning# bud run
| Listening on http://127.0.0.1:3000
| conjure: generate "bud/internal/app/main.go". app: unable to load state: app: unable to wire. di: unable to wire "github.com/Bishwas-py/bud-learning/bud/program".loadWeb function. di: unable to find definition for param "github.com/livebud/bud/package/router".*Router in "github.com/Bishwas-py/bud-learning/bud/internal/app/web".*Server . parser: unable to find declaration for "github.com/livebud/bud/package/router".Router in "bud/internal/app/web/web.go". stat /root/go/pkg/mod/github.com/livebud/[email protected]: no such file or directory

Bishwas-py avatar Aug 06 '22 04:08 Bishwas-py

But I dunno if this is a proper solution but it work for my user, wherever it give this weird error for my root.

The error is related to bud not being able to find the runtime. That should happen automatically though during bud create. Maybe that's the problem then. Does running go mod download all not work for some permissions reason?

https://github.com/livebud/bud/blob/97195d44386369d6c54b1f99e79df80ead0c3ea4/internal/cli/create/create.go#L172-L177

Also after reading the following again

I am very new to bud, I am an indie dev. And was trying out bud, but bun run give me : -mod=mod not supported (can be '', 'readonly', or 'vendor')

It seems like the problem is that your module cache in go env GOMODCACHE isn't writable.

matthewmueller avatar Aug 07 '22 16:08 matthewmueller