Recently spun up a D7 site with Foundation as a base theme. While setting up a sub theme and Grunt as described in the documentation I ran in to binding errors when attempting to run Grunt as older versions of node-sass and grunt-sass are installed with the provided package.json file. I simply updated the version #s declared for each in the package.json file to the latest version of each and things are running fine.

Comments

iamrentman created an issue. See original summary.

iamrentman’s picture

Title: package.json outdated node-sass & grunt-sass » package.json installs outdated node-sass & grunt-sass
iamrentman’s picture

Issue summary: View changes
spanners’s picture

Following on from this, I found the same thing. And I found it when editing an existing website after I'd updated my Mac's node.js to version 7.x. Node modules were WAY out of date.

I'm to drop in the error message here, in case someone is Googling for a solution.

$ grunt
Loading "sass.js" tasks...
ERROR
>> Error: `libsass` bindings not found. Try reinstalling `node-sass`?Warning: Task "sass" not found. Use --force to continue.

Aborted due to warnings.

If you come across this, update your subtheme's package.json file with new dependencies. You can search for the latest versions on http://npm.im

Or if you want to try the working dependencies current at the time of my post, replace lines 5 through 13 of the package.json file of your ZURB Foundation subtheme with...

"node-sass": "~4.5.2",
"grunt": "~1.0.1",
"grunt-contrib-watch": "~1.0.0",
"grunt-sass": "^2.0.0",
"grunt-drush": "*",
"node-bourbon": "4.2.8",
"grunt-contrib-jshint": "~1.1.0",
"grunt-contrib-uglify": "~2.3.0",
"load-grunt-tasks": "~3.5.2"

I can confirm that these work with the D7 Foundation 5 theme - have fixed multiple websites and tried it on a fresh install as well.

NOTE: If you're updating an existing Drupal 7 site with a ZURB Foundation theme, you might find a few issue with deprecated classes and functionality (eg. you can't @extend inside a @media query). Don't panic! Just work your way through the errors (or comment out the offending lines) and keep going until grunt runs correctly.

spanners’s picture

StatusFileSize
new1.64 KB

I've attempted rolling a patch together for updating to the node dependencies zurb_foundation. I pulled down a fresh copy of 7.x-5.0-rc6 and made a diff of the changes to the package.json and STARTER/package.json file.

Note that this is for trying to fix a fresh install of sites/all/theme/zurb_foundation - it won't work on an existing subtheme. I'm pretty new to the whole patch-rolling thing, so hopefully someone can help me create one for an existing subtheme (basically ignoring the "name" entry in the package.json file).

spanners’s picture

Status: Active » Needs review
hongpong’s picture

I think this can probably be committed to 7.x-5.x unless someone has an objection. If this is breaking installation it should go in.

kclarkson’s picture

I just spent a good amount of a day or so trying to figure this out where the errors were coming from when trying to update D7 Zurb Theme after I had updated node and some other stuff. Error's excluding deprecation have gone away thanks to @Spanners #4 suggestion.

Would like to see this added to dev!

apmsooner’s picture

Status: Needs review » Reviewed & tested by the community

Patch works.

  • HongPong committed b5dd053 on 7.x-5.x authored by Spanners
    Issue #2804703 by Spanners: package.json installs outdated node-sass...
hongpong’s picture

Status: Reviewed & tested by the community » Fixed

Thank you Spanners, apmsooner, kclarkson, iamrentman for reporting this issue and testing the fix. Committed!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.