Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

You must call hexya module new from a project directory #128

Open
felipechang opened this issue Dec 14, 2020 · 3 comments
Open

You must call hexya module new from a project directory #128

felipechang opened this issue Dec 14, 2020 · 3 comments

Comments

@felipechang
Copy link

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}}'

@gleke
Copy link

gleke commented Jan 16, 2021

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/base@v0.1.6/attachment.go:61:35: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:61:52: undefined: m.AttachmentData
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:71:28: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:76:29: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:81:33: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:99:29: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:105:28: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:116:29: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:137:30: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:155:31: undefined: m.AttachmentSet
../../go/pkg/mod/github.com/hexya-addons/base@v0.1.6/attachment.go:155:31: too many errors

github.com/hexya-addons/web/controllers

../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/action.go:24:12: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/action.go:24:33: undefined: q.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/assets.go:99:11: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/assets.go:99:32: undefined: q.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/binary.go:28:10: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/binary.go:33:10: undefined: h.Company
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/session.go:58:12: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/session.go:58:33: undefined: q.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/session.go:145:9: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/webclient.go:198:12: undefined: h.User
../../go/pkg/mod/github.com/hexya-addons/web@v0.1.7/controllers/webclient.go:198:12: too many errors

can you run right? please tell me how to do

@AleksandrMac
Copy link

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" {

@gladstons
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants