Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-55856

More elegantly handle unsupported node versions

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2
    • Fix Version/s: 3.2
    • Component/s: JavaScript
    • Labels:
    • Testing Instructions:
      Hide

      For this test, you need a 'too old' node version and new node version. You can get that with nvm.sh or alternative approache.

      1. On install with node <4 run `grunt js`
      2. VERIFY: you get a clear error about the version of node being too old.
      3. On node >=4 run `grunt js`
      4. VERIFY: the grunt run completes successfully
      Show
      For this test, you need a 'too old' node version and new node version. You can get that with nvm.sh or alternative approache. On install with node <4 run `grunt js` VERIFY: you get a clear error about the version of node being too old. On node >=4 run `grunt js` VERIFY: the grunt run completes successfully
    • Affected Branches:
      MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE
    • Pull Master Branch:
      MDL-55856-master

      Description

      Right now if you use a too old node version you get something like this:

      $ grunt less
      
      /Users/danp/moodles/im/moodle/node_modules/grunt-eslint/tasks/eslint.js:2
      const chalk = require('chalk');
      ^^^^^
      Loading "eslint.js" tasks...ERROR
      >> SyntaxError: Use of const in strict mode.
      
      Running "less:bootstrapbase" (less) task
      >> 2 stylesheets created.
      
      Done.
      

      Unfortunately the package.json enginge requirement doesn't work so awesomely. Potentially we can use https://www.npmjs.com/package/grunt-node-version or something simpler to at least give a decent error.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    5/Dec/16