moodle-plugin-ci
moodle-plugin-ci copied to clipboard
moodle-plugin-ci install fails: "grunt ignorefiles" wants a newer nodejs version
$ moodle-plugin-ci install
5/8 [=================>----------] 62% 29 secs [Install npm dependencies]
In ProcessHelper.php line 97:
The command "grunt ignorefiles" failed.
Exit Code: 1(General error)
Working directory: /home/travis/build/moodle
Output:
================
Fatal error: Node version not satisfied. Require >=14.0.0 <15.0.0, version
installed: 8.9.4
Error Output:
================
Probably needed to update to a newer nodejs version and make the codebase compatible to it
Change
- nvm install 8.9
- nvm use 8.9 into
- nvm install 14.2.0
- nvm use 14.2.0 in your .travis.yml file MDL-66109
Thank you @ewallah. Gonna try this out.
The https://github.com/blackboard-open-source/moodle-plugin-ci/blob/master/.travis.dist.yml still suggests 8.9
Confirm, setting node to v14.2.0 works pretty good. I now only get a compilation error only in MOODLE_36_STABLE: https://travis-ci.org/github/frankkoch/moodle-mod_studentquiz/builds/688327102. All the others are fine: MOODLE_35_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
I get the same failure on MOODLE_36_STABLE with auth_saml2 (not my plugin, I'm just working on it atm) https://travis-ci.org/github/sammarshallou/moodle-auth_saml2/jobs/688465656
The specific failure is from npm install:
Cannot download "https://github.com/sass/node-sass/releases/download/v4.9.3/linux-x64-83_binding.node"
Then it tries to compile it from source, which results in a lot of output and eventual failure.
There is no linux-x64-83_binding.node in the sass releases downloads area; the highers number for 4.9.3 is linux-x64-64_binding.node. The first version that has an -83_binding.node is 4.14.0. (I know nothing about sass and don't know what the numbers relating to 'binding' are... Node version maybe...)
After discussion with Andrew Nicols from Moodle HQ, I learned that the reason for this is basically that Moodle 3.6 is no longer in support, and therefore (unlike 3.5 LTS, 3.7, 3.8 and master) it still requires the old Node version.
In case it helps others, here is my pull request for auth_saml2 including a fixed Travis yml which selects different Node version for moodle version: https://github.com/catalyst/moodle-auth_saml2/pull/427
Andrew says the proper fix is to run 'nvm use' after downloading moodle files, and before running npm install. This should automatically use the correct version for the Moodle version under test. I think that happens inside the 'moodle-plugin-ci install -vvv' line, so it would need a change to moodle-plugin-ci.