h5p / h5p-cli

Command Line Interface
MIT License
62 stars 30 forks source link

Problems with quick start 'setup' command #119

Open gxclarke opened 3 days ago

gxclarke commented 3 days ago

Hello there!

I'm following the quick start guide in the README and would like to report some problems running the following command:

h5p setup h5p-course-presentation

The installation fails with the following:

Error: ENOTEMPTY: directory not empty, rmdir 'libraries/H5P.OpenEndedQuestion-1.0/node_modules'

The node_modules folder contains a hidden .DS_Store file. Reading about this, it seems auto-created on Macs. Did the author accidentally commit it? Fixed by:

rm -rf node_modules

And then re-running the h5p setup command.

Next, the same problem, but this time with:

Error: ENOTEMPTY: directory not empty, rmdir 'libraries/H5P.Dialogcards-1.9/node_modules'

After re-running again:

>> ~ updating to h5p-editor-vertical-tabs 1.3.9
error: cannot pull with rebase: You have unstaged changes.
error: Please commit or stash them.
> error
Error: Command failed: git pull origin
error: cannot pull with rebase: You have unstaged changes.
error: Please commit or stash them.

I am still looking for a workaround for this one.

gxclarke commented 2 days ago

I tried again today, and I did not encounter the problem of the directory not being empty. Presumably, this is a local issue on my machine, so let's disregard it.

Regarding the unstaged changes, the following screenshot shows the unstaged change:

image

I looked at https://github.com/h5p/h5p-editor-vertical-tabs and saw that "MIT" is in package.json file, but "ISC" is in package-lock.json.

My theory is that:

  1. The h5p tool runs npm install, which overwrites the lock file.
  2. The lock file is an unstaged change.
  3. The h5p tool then runs git pull command.
  4. The pull command fails because it would overwrite the unstaged change.
otacke commented 2 days ago

@gxclarke I think all you need to do is what git tells you to: Stash those unstaged commits of your's, done.

gxclarke commented 2 days ago

@otacke I haven't made any changes. This is resulting from h5p setup h5p-course-presentation (from the quick start guide in the readme). Yes, I can stash the change, but the setup errored out at this point.

gxclarke commented 2 days ago

Apologies for not making this clearer, but the rebase error causes H5P to error out:

image

otacke commented 2 days ago

@gxclarke I don't think that I can reproduce this. Maybe tomorrow will shed some more light on things.

otacke commented 1 day ago

@gxclarke Sorry, can't reproduce this on my end. h5p setup h5p-course-presentation does its job just file here, even if run multiple times with the h5p-editor-vertical-tabs library having been build in the first run.

@devland is the main developer of the H5P CLI tool (I am not a member of the H5P core team). Maybe he can reproduce the issue.