hexya
hexya copied to clipboard
You must call hexya module new from a project directory
Hi,
I'm getting the following error "You must call hexya module new from a project directory" when running the "hexya module new openacademy" from the tutorial. Windows 10, Go 1.15.6
Issue is in cmd/module.go:78
c := exec.Command("go", "list", "-f", "'{{ .Name }}")
Fixing the .Name like this works for me
c := exec.Command("go", "list", "-f", "'{{.Name}}'")
Which is equivalent to this
go list -f '{{.Name}}'
configfilename = "" datadir = "/home/gleke/.hexya" debug = false demo = false logfile = "" loglevel = "info" logstdout = false modules = ["github.com/hexya-addons/web"] resourcedir = "./res"
[db] driver = "postgres" host = "/var/run/postgresql" name = "hexya" password = "gleke" port = "5432" sslca = "" sslcert = "" sslkey = "" sslmode = "disable" user = "gleke"
[server] certificate = "" domain = "" interface = "" languages = [] port = "8080" privatekey = ""
my system: ubuntu 18.04 go 1.15 I find also failed create database table when I set host = "/var/run/postgresql" the hexya can't connect the database,but database user and password is right
hexya server -o While parsing config: (22, 3): The following key was defined twice: db.user Please wait, Hexya is starting ...
github.com/hexya-addons/base
../../go/pkg/mod/github.com/hexya-addons/[email protected]/attachment.go:61:35: undefined: m.AttachmentSet ../../go/pkg/mod/github.com/hexya-addons/[email protected]/attachment.go:61:52: undefined: m.AttachmentData ../../go/pkg/mod/github.com/hexya-addons/[email protected]/attachment.go:71:28: undefined: m.AttachmentSet ../../go/pkg/mod/github.com/hexya-addons/[email protected]/attachment.go:76:29: undefined: m.AttachmentSet ../../go/pkg/mod/github.com/hexya-addons/[email protected]/attachment.go:81:33: undefined: m.AttachmentSet ../../go/pkg/mod/github.com/hexya-addons/[email protected]/attachment.go:99:29: undefined: m.AttachmentSet ../../go/pkg/mod/github.com/hexya-addons/[email protected]/attachment.go:105:28: undefined: m.AttachmentSet ../../go/pkg/mod/github.com/hexya-addons/[email protected]/attachment.go:116:29: undefined: m.AttachmentSet ../../go/pkg/mod/github.com/hexya-addons/[email protected]/attachment.go:137:30: undefined: m.AttachmentSet ../../go/pkg/mod/github.com/hexya-addons/[email protected]/attachment.go:155:31: undefined: m.AttachmentSet ../../go/pkg/mod/github.com/hexya-addons/[email protected]/attachment.go:155:31: too many errors
github.com/hexya-addons/web/controllers
../../go/pkg/mod/github.com/hexya-addons/[email protected]/controllers/action.go:24:12: undefined: h.User ../../go/pkg/mod/github.com/hexya-addons/[email protected]/controllers/action.go:24:33: undefined: q.User ../../go/pkg/mod/github.com/hexya-addons/[email protected]/controllers/assets.go:99:11: undefined: h.User ../../go/pkg/mod/github.com/hexya-addons/[email protected]/controllers/assets.go:99:32: undefined: q.User ../../go/pkg/mod/github.com/hexya-addons/[email protected]/controllers/binary.go:28:10: undefined: h.User ../../go/pkg/mod/github.com/hexya-addons/[email protected]/controllers/binary.go:33:10: undefined: h.Company ../../go/pkg/mod/github.com/hexya-addons/[email protected]/controllers/session.go:58:12: undefined: h.User ../../go/pkg/mod/github.com/hexya-addons/[email protected]/controllers/session.go:58:33: undefined: q.User ../../go/pkg/mod/github.com/hexya-addons/[email protected]/controllers/session.go:145:9: undefined: h.User ../../go/pkg/mod/github.com/hexya-addons/[email protected]/controllers/webclient.go:198:12: undefined: h.User ../../go/pkg/mod/github.com/hexya-addons/[email protected]/controllers/webclient.go:198:12: too many errors
can you run right? please tell me how to do
Hello
I also get an error, when running "hexya module new openacademy" from the tutorial, the following error appears: "You must call the hexya new module from the project directory." Windows 10, Go 1.16.3
Issue is in cmd/module.go:80 if res, err := c.Output(); err != nil || string(res) != "main" {
Fixed by adding delete characters "'\n" if res, err := c.Output(); err != nil || strings.Trim(string(res), "'\n") != "main" {
It looks like you're encountering issue #128 related to calling 'hexya module new' from a project directory. Have you considered navigating to your project directory before executing the command? Double-checking your current directory and trying again might resolve the problem on Slide Share. If issues persist, consulting the documentation or community forums could provide additional insights. Happy coding!