Open rezeau opened 1 week ago
I think it is an issue with Windows or rather the scripts assuming some commands to be available on the platform. Those scripts were changed in the respective repositories. That's why you're experiencing the issues. Has nothing to do with H5P CLI.
NODE_ENV
variable (https://github.com/h5p/h5p-editor-vertical-tabs/commit/88bcaf839b567368c68ca207c4d2e0bb3f95cdb7) for determining whether the mode should be "production" or "development", changing how the distribution files get built. That's not how it's done on Windows however, that's why the build script does not work.
Either one needs to use a workaround like the package cross-env
as it is done in many other H5P content types by H5P Group to ensure that setting environment variables works across platforms (see e.g. https://github.com/h5p/h5p-drag-question/blob/master/package.json#L9). Or one uses the --mode
argument that webpack supports since version 5 I think (cmp. https://webpack.js.org/configuration/mode/). The latter is what I prefer for my content types in order to reduce the number of dependencies - no cross-env
needed.rm
and patch
. rm
is the equivalent of del
on Windows. If there's no alias available (I think the PowerShell should have one), then this will not work. Likewise, patch
would need to point to the right tool unless it's available for Windows out of the box - dunno.I agree that scripts should be platform agnostic.
No, https://github.com/h5p/h5p-cli/issues/119 was caused by the user having configured git globally to rebase when pulling.
[Edit] I just created https://h5ptechnology.atlassian.net/browse/HFP-4158
@otacke Thanks for your speedy and detailed reply. In the end I somehow managed to get all the H5P core contents installed as well as my own contents..😊But I will look at the various workarounds you suggest for my Windows environment.
It sounds like you tried to run the h5p commands in the regular windows cli environment. That is not advised. Some of the h5p-cli commands are Linux & MacOS specific. On Windows it’s recommended that you run them inside git bash.
@devland Thanks for the tip. I have now set up bash for Windows to run the h5p-cli commands and all is working as expected. May I suggest that the h5p-cli make it very clear for Windows users? Thanks.
This is a fresh install of h5p-cli on a Windows 11 platform, with node.js, npm installed. It used to work with previous version of h5p-cli.
All goes well with Steps 0 and 1: _mkdir my_first_h5p_environment cd my_first_h5penvironment Install the core H5P libraries. h5p core with messages: done setting up h5p-math-display done setting up core libraries
But things go wrong with Step 2: Setup an H5P library such as h5p-course-presentation. h5p setup h5p-course-presentation
This starts setting up a few libraries, but stops on these 2 setups: 1.-installing h5p-editor-vertical-tabs 1.3.9 Cloning into 'H5PEditor.VerticalTabs-1.3'... _npm run build 'NODEENV' is not recognized as an internal or external command, an executable program, or a batch file. OK I can solve this by going into dir H5PEditor.VerticalTabs-1.3 and running npx webpack successfully
Then I run again h5p setup h5p-course-presentation... it starts ok but triggers another error:
2.- + installing shepherd 1.0.6 Cloning into 'Shepherd-1.0'... npm run build 'rm' is not recognized as an internal or external command, an executable program, or a batch file.
At that stage the following libraries have been installed and I can use them on h5p-server: h5p-audio; h5p-blanks; h5p-dialogcards; h5p-drag-question; h5p-drag-text; h5p-mark-the-words; h5p-multi-choice; h5p-multi-media-choice; h5p-questionnaire; h5p-single-choice-set; h5p-summary; h5p-true-false But I cannot find a way to setup the Shepherd library. What is strange is that it seems to use the "tether" library, but that library is NOT installed???
I don't think the issue comes only from the fact that I'm using a Windows environment, but anyway the various package.json files should be made in such a way that the libraries can be build independently of the environment used.
And again I insist that I did not have this issue with the previous version of h5p-cli (or previous versions of the H5PEditor.VerticalTabs and Shepherd libraries ?)
Note: This issue looks similar to Problems with quick start 'setup' command #119