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

More elegantly handle unsupported node versions

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.2
    • 3.2
    • JavaScript
    • MOODLE_32_STABLE
    • MOODLE_32_STABLE
    • MDL-55856-master
    • 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

    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.

      Attachments

        Issue Links

          Activity

            People

              poltawski Dan Poltawski
              poltawski Dan Poltawski
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Adrian Greeve Adrian Greeve
              David Woloszyn, Huong Nguyen, Jake Dallimore, Michael Hawkins, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                5/Dec/16