5

I'm trying to replace grunt-scss-lint (because of its Ruby dependency and silent failure when you don't have the gem installed) with stylelint.

The problem I'm running into is the following error:

$ grunt                                                                        
Loading "Gruntfile.js" tasks...ERROR
>> ReferenceError: Map is not defined

I assume this is because stylelint (which is a PostCSS plugin, not a Grunt plugin) requires ES6.

Here's the code that's throwing the Map is not defined error.

Is there any way to get this to work where I can just run grunt and not some weird workaround like this?

Community
  • 1
  • 1
Trey Piepmeier
  • 1,006
  • 2
  • 13
  • 21
  • I realize that stylelint requires all the new hotness, but I still don't know how to get that working with Grunt. https://github.com/stylelint/stylelint#requirements – Trey Piepmeier Jul 30 '15 at 16:16
  • Can you share your gruntfile.js please? I'm having a hard time hooking up grunt+stylelint+sass – V Maharajh Feb 16 '16 at 16:44
  • Please edit the question with the relevant part of your gruntfile.js included. Your external link returns a 404. – Kit Johnson Feb 12 '19 at 05:59

1 Answers1

6

Looks like you just need to upgrade your version of Node. If you run 0.12 or higher, you shouldn't have troubles with Map. (The --harmony flag that makes that "weird workaround" weird is not required in 0.12+.)

The Node installation is independent of Grunt. Run node -v to see what's there. And if you need an upgrade, just use nodejs.org to get the latest.

davidtheclark
  • 4,666
  • 6
  • 32
  • 42