Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Loading "sass.js" tasks...ERROR #209

Closed
rowphant opened this issue Feb 11, 2015 · 51 comments
Closed

Loading "sass.js" tasks...ERROR #209

rowphant opened this issue Feb 11, 2015 · 51 comments

Comments

@rowphant
Copy link

When im running "grunt build" in the terminal i just get a
"Loading "sass.js" tasks...ERROR".
Error: Cannot find module 'node-sass'
Warning: Task "sass" not found. Use --force to continue.

So i can not use grunt to merge all the files.

I can do "grunt build -force", which works but that not the solution of this problem. ;)
Im quite new to all that grunt stuff, so i dont get it. Any solutions for this problem?

Btw im using a Mac if that matters.

@themestechnology
Copy link
Contributor

cd to directory

then

sudo gem clean

sudo gem install foundation

sudo npm install -g bower grunt-cli

sudo npm install

grunt build

grunt / grunt serve / grunt watch

Also build and grunt may require you to not be login in a su

http://foundation.zurb.com/docs/sass.html

@rowphant
Copy link
Author

Thanks for your quick answer.
Next Problem: everytime using "npm" it says "command not found" although node.js is actually installed.
...im confused

@themestechnology
Copy link
Contributor

#sudo npm uninstall npm -g
#sudo apt-get remove nodejs

#sudo apt-get install nodejs nodejs-dev npm

@rowphant
Copy link
Author

apt-get: command not found .....

is it really such a complicated thing to just get that node-grunt-whatever-stuff running? im getting desperate -.- ...but looking forward for more help ^^

@themestechnology
Copy link
Contributor

what OS are you using... apt-get is Ubuntu/Debian there should be a simlar command for your OS ie.

https://github.com/joyent/node/wiki/installing-node.js-via-package-manager

@Aetles
Copy link
Contributor

Aetles commented Feb 11, 2015

"Btw im using a Mac if that matters."

@rowphant
Copy link
Author

» OSx Yosemite (10.10.2)

But i dont know what this problem could have to do with my node.js installation cause i downloaded the current version of it. So a reinstallation by terminal probably wont solve this problem or am i wrong?

@Aetles
Copy link
Contributor

Aetles commented Feb 11, 2015

I think the recommended way to install Node.js for Mac is the installer from http://nodejs.org/download/

It's the suggested way here for example: http://coolestguidesontheplanet.com/installing-node-js-on-osx-10-10-yosemite/ and the Read Me for FoundationPress says the same thing.

@rowphant
Copy link
Author

then i should be on the right way. on "echo $PATH" it says:
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin

but what now?

still got the error message on "grunt build":
grunt build
Loading "sass.js" tasks...ERROR

Error: Module did not self-register.
Warning: Task "sass" not found. Use --force to continue.

Aborted due to warnings.

@rowphant
Copy link
Author

I just made a complete new repo clone to get everything new and clear. I got stuck at this point:

npm install && bower install && grunt build

[email protected] install /Users/rowphant/Web/htdocs/wordpress_40_de/wp-content/themes/FoundationPress-Git/node_modules/node-sass
node scripts/install.js

Binary downloaded and installed at /Users/rowphant/Web/htdocs/wordpress_40_de/wp-content/themes/FoundationPress-Git/node_modules/node-sass/vendor/darwin-x64/binding.node

[email protected] postinstall /Users/rowphant/Web/htdocs/wordpress_40_de/wp-content/themes/FoundationPress-Git/node_modules/node-sass
node scripts/build.js

darwin-x64 exists; testing
module.js:355
Module._extensions[extension](this, filename);
^
Error: Module did not self-register.
at Error (native)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object. (/Users/rowphant/Web/htdocs/wordpress_40_de/wp-content/themes/FoundationPress-Git/node_modules/node-sass/lib/index.js:181:15)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
npm ERR! Darwin 14.1.0
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.12.0
npm ERR! npm v2.5.1
npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node scripts/build.js'.
npm ERR! This is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node scripts/build.js
npm ERR! You can get their info via:
npm ERR! npm owner ls node-sass
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/rowphant/Web/htdocs/wordpress_40_de/wp-content/themes/FoundationPress-Git/npm-debug.log

@joshsmith01
Copy link
Contributor

I have the same issue...on one of my two computers. The only difference is the the versions of npm on each of my machines. The version that works is 1.4.28 and the version that doesn't work is 2.5.1. I look around and see that node-sass module was an issue but many are saying that it was fixed. I don't know what to do at this point, either.

If I knew how to roll back my npm to 1.4.28 I would. That particular version isn't available anymore. I just switched my project over to Codekit to get it out the door but I am tuned into this issue.

@rowphant
Copy link
Author

Thats what I read on another website too, there were issues with the current version. ....Well great! :D
And everytime im doing "npm update -g npm" it kicks off npm from my system and i have to reinstall node. Is this what it should do? I dont think so.
All in all, this npm-stuff seems to be very tinkered and not stable at all and so far i dont see any benefits using it when regular installation routines dont work. Im really tired of that but still looking forward for finding a solution.

@Aetles
Copy link
Contributor

Aetles commented Feb 11, 2015

Have you tried install -g npm@ 1.4.28 to downgrade npm? (Or maybe sudo install -g npm@ 1.4.28.)

@rowphant
Copy link
Author

i've tried npm install [email protected] and it gives back version not found: [email protected]
When using install -g npm@ 1.4.28 it gives back
usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
[-o owner] file1 file2
install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
[-o owner] file1 ... fileN directory
install -d [-v] [-g group] [-m mode] [-o owner] directory ...

Got stuck here again. :S
Um...sorry im not (yet) that familiar with command line tools.

@rowphant
Copy link
Author

i tried to rollback node by "Node Version Manager" (https://github.com/tj/n) and tried several older versions of node with NO success.... -.-

@luciaarsena
Copy link

It's the same problem I've got, but on windows platform.

@rowphant
Copy link
Author

Isnt there any alternative to bypass this annoying issue but compile the js and css files though?

Several forums are full with people discussing about that node-sass thing. Some say it worked with a downgrade of Node others are still having the problem. This clearly shows that no one really seems to have a clue. How is this possible?
My decision to give Node and Grunt a try was based on a lot of articles i read. A lot of people praise these tools cause "it's so easy and simple to use"....I see ^^
Then comes another update and everything seems to break and no one knows why. For me its incomprehensible how this can happen. I mean, why are there Version Managers when they dont affect anything?
Im sorry when i seem to be a upset (im actually not ^^) but its getting very irritating when you rely on tools you have/would like to work with.
Im ready to help but no one can tell me where the problem exactly is. :D

@Aetles
Copy link
Contributor

Aetles commented Feb 11, 2015

First, it is usually not this complicated. I have not tried to set up a new FoundationPress theme recently, but it has worked well for me before. It is easy and a blessing when it works.

But this is a world where everything is moving forward and sometimes it is not as stable as it should. For a period there were some complicated issues with Foundation moving to a more recent version of SASS that libsass (the much faster, but often behind, SASS compiler) did not support and caused a lot of trouble (as can be seen in the list of previous issues here). I pulled my hair trying to temporary switch to compass but gave up.

(On top of that FoundationPress has not been very stable lately. I don't wanna sound too harsh but there where a bunch of pull request recently that were not very well prepared (containing obvious errors if you just looked at the diff, like dashes on every line) that quickly got merged into master without proper audit causing FoundationPress to throw errors.)

@olefredrik
Copy link
Owner

Hi guys,

Can those of you who are experiencing problems with FoundationPress install do a node -v and post your version number in this thread?

Cheers.

@rowphant
Copy link
Author

Hi Olefredrik!
I installed "n" (https://github.com/tj/n) for a better Node Version Control. I've tried several version with no success:
0.9.10
0.10.0
0.10.26
0.10.32
0.10.33
0.10.35
0.10.36
0.11.0
0.11.1
0.11.14
0.11.15
0.11.16
0.12.0

@olefredrik
Copy link
Owner

Hi. Can you please run a npm -v in your terminal and add a comment in this thread with your current installed version?

@joshsmith01
Copy link
Contributor

npm 2.5.1

@joshsmith01
Copy link
Contributor

node v0.12.0

@rowphant
Copy link
Author

npm 1.4.3
node v0.12.0

@ianecross
Copy link

Hi, I'm using node v0.12.0 and npm 2.5.1 on win 7. I

followed the instructions on the foundationpress github page:

cd my-wordpress-folder/wp-content/themes/
git clone [email protected]:olefredrik/FoundationPress.git
mv FoundationPress your-theme-name
cd your-theme-name
npm install && bower install && grunt build

and I get the error:

15456 error Windows_NT 6.1.7601
15457 error argv "c:\Program Files\nodejs\node.exe" "c:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install"
15458 error node v0.12.0
15459 error npm v2.5.1
15460 error code ELIFECYCLE
15461 error [email protected] postinstall: node scripts/build.js
15461 error Exit status 1
15462 error Failed at the [email protected] postinstall script 'node scripts/build.js'.
15462 error This is most likely a problem with the node-sass package,
15462 error not with npm itself.
15462 error Tell the author that this fails on your system:
15462 error node scripts/build.js
15462 error You can get their info via:
15462 error npm owner ls node-sass
15462 error There is likely additional logging output above.

After following the instructions at the beging of this thread:

sudo gem clean
sudo gem install foundation
sudo npm install -g bower grunt-cli
sudo npm install
grunt build
grunt / grunt serve / grunt watch

I get the same error.

@luciaarsena
Copy link

I've solved installing nodejs version 0.10.33 (Stable) 2014.10.20 and git. Launching 'npm install && bower install && grunt build' from git now it works. I hope this can help.

@olefredrik
Copy link
Owner

I have now spent some time to understand the problem. And I've come up with a solution that works.

Previously I have not had any problem setting up Foundation or FoundationPress with grunt and libsass. But my dev environment have run an older version of node (v.0.10.33 to be exact). I cleared my npm cache and updated node to latest stable version. And yep, I got the same error as you did.

So I went to foundation.zurb.com to download the latest foundation libsass version available. Guess what? It failed. Which tells me that the error is not exclusive for FoundationPress, but a general issue somewhere between libsass and last version of the node.

Anyway. What you should do to get everything to work as normal, is to roll back node to v.0.10.33. It's quite simple. Here is what you do:

On Linux or Mac:
NPM install -g n
n 0.10.33

On Windows:
npm install -g nvmw
nvmw install v0.10.33
nvmw use v0.10.33

Voila!

Can you try this and post a comment back if this does the trick?

(cc @rowphant , @joshsmith01)

@rowphant
Copy link
Author

It works!
After first try it didnt. Then I recloned and reinstalled the repo. Now it works perfectly.

  • Node: 0.10.33
  • NPM: 1.4.3

@mariuskroh
Copy link

@olefredrik
not working for me, got Node 0.10.33 and NPM 1.4.28... also not working after cleaning the cache, recloning and updating NPM to 2.5.0 :/

@olefredrik
Copy link
Owner

@rowphant : Nice 👍
@mariuskroh : This is strange. Unable to reproduce the error here. Makes little sense that it works for me and @rowphant , but not with you. Will look into this and see whan I can do, when I get time.

@mariuskroh
Copy link

@olefredrik
I downgraded [email protected] and it works now but some dependencies aren't met as it needs @1.2.3.
bower install and grunt build work without errors and everything seems to be up and running.
I'm quite new to this stuff so the problem might be on my side though

@olefredrik
Copy link
Owner

@mariuskroh
Thank you very much for your input. The whole point of this starter-theme is that it should be easy peasy to get up and running in no time. If people end up spending hours on installation, it will be counterproductive and frustrating. I'll have a look at it when I have some time to spare.

@ianecross
Copy link

Working with node v0.10.33 npm 2.5.1. Nice one!

@Strutsagget
Copy link

I get this error trying all steps above
Loading "sass.js" tasks...ERROR

Error: dlopen(....../node_modules/grunt-sass/node_modules/node-sass/vendor/darwin-x64/binding.node, 1): no suitable image found. Did find:
/......../node_modules/grunt-sass/node_modules/node-sass/vendor/darwin-x64/binding.node: file too short

@dogseven
Copy link

I had this working last night, following the instructions to re-set node. This morning, I get this:
C:\develop4\wordpress\www\wp-content\themes\fp1>grunt watch
Loading "sass.js" tasks...ERROR

Error: no errorC:\develop4\wordpress\www\wp-content\themes\fp1\node_modules\node-sass\vendor\win32-x64\binding.node

Running "watch" task
Waiting...OK

File "scss\config_settings.scss" changed.

Loading "sass.js" tasks...ERROR

Error: no errorC:\develop4\wordpress\www\wp-content\theme\fp1\node_modules\node-sass\vendor\win32-x64\binding.node
Warning: Task "sass" not found. Use --force to continue.

Aborted due to warnings.
Completed in 2.839s at Fri Feb 27 2015 10:08:08 GMT+0100 (Hora estándar romance)

Node V0.12.0, npm V2.5.1, Windows 7 and Wampserver
Any suggestions, please?

@Strutsagget
Copy link

I got it working after updating gruns-sass and node-sass to latest versions and changed my Grunfile to reflect that.

https://github.com/sass/node-sass
https://github.com/sindresorhus/grunt-sass

@dogseven
Copy link

Thanks, I will try that.

But what confuses me, is that it was working last night! And I changed nothing, but I got those error messages.

@dogseven
Copy link

I tried your suggestions re node-sass and grunt-sass. But where / what is the gruntfile?

@Strutsagget
Copy link

Sorry were mixing up my drupal and wordpress foundation themes :)

Dint do any changes to gruntfile.js but made sure the changes to the version so they were correct in package.json

Also I followd all the bold stuff in post number two.

@Taiisan
Copy link

Taiisan commented Mar 3, 2015

@dogseven once once you follow these directions:

npm install -g nvmw
nvmw install v0.10.33
nvmw use v0.10.33

every time you want to run the grunt task enter:

nvmw use v0.10.33
grunt watch

This in my exprience (and I'm a complete and utter noob) forces it to use this version. It's working for me (win7 - mamp).

Hope this helps!

@dogseven
Copy link

dogseven commented Mar 4, 2015

I got an error message after grunt watch, then (as expected) got one when I changed _settings.scss

C:\develop4\wordpress\www\wp-content\themes\fp2>grunt watch
Loading "sass.js" tasks...ERROR

Error: no errorC:\develop4\wordpress\www\wp-content\themes\fp2\node_modules\n
ode-sass\vendor\win32-x64\binding.node

Running "watch" task
Waiting...OK

File "scss\config_settings.scss" changed.

Loading "sass.js" tasks...ERROR

Error: no errorC:\develop4\wordpress\www\wp-content\themes\fp2\node_modules\n
ode-sass\vendor\win32-x64\binding.node
Warning: Task "sass" not found. Use --force to continue.

Aborted due to warnings.
Completed in 6.866s at Wed Mar 04 2015 09:37:37 GMT+0100 (Hora estándar romance)

  • Waiting...

@kapil0110
Copy link

Solved.

I was also not sure until I read foundation/foundation-libsass-template#16 and figured out that (as @olefredrik has explained) node-sass has issues.

Simply open package.json and change to "node-sass" : "~0.9.6" (should be compatible) from whatever version is there. In my case it was 1.2.3.

Hope this helps somebody.

@Taiisan
Copy link

Taiisan commented Mar 4, 2015

@kapil0110 This worked for me (without having to tell it which version to use everytime I open cmd).

Thank you!

@dogseven
Copy link

dogseven commented Mar 5, 2015

Didn't work for me (:-<

C:\develop4\wordpress\www\wp-content\themes\fp2>grunt watch
Loading "sass.js" tasks...ERROR

Error: no errorC:\develop4\wordpress\www\wp-content\themes\fp2\node_modules\n
ode-sass\vendor\win32-x64\binding.node

Running "watch" task
Waiting...OK

File "scss\config_settings.scss" changed.

Loading "sass.js" tasks...ERROR

Error: no errorC:\develop4\wordpress\www\wp-content\themes\fp2\node_modules\n
ode-sass\vendor\win32-x64\binding.node
Warning: Task "sass" not found. Use --force to continue.

Aborted due to warnings.
Completed in 3.443s at Thu Mar 05 2015 11:34:45 GMT+0100 (Hora estándar romance)

  • Waiting...
    ^C¿Desea terminar el trabajo por lotes (S/N)? s

C:\develop4\wordpress\www\wp-content\themes\fp2>grunt watch
Loading "sass.js" tasks...ERROR

Error: no errorC:\develop4\wordpress\www\wp-content\themes\fp2\node_modules\n
ode-sass\vendor\win32-x64\binding.node

Running "watch" task
Waiting...OK

File "scss\config_settings.scss" changed.

Loading "sass.js" tasks...ERROR

Error: no errorC:\develop4\wordpress\www\wp-content\themes\fp2\node_modules\n
ode-sass\vendor\win32-x64\binding.node
Warning: Task "sass" not found. Use --force to continue.

Aborted due to warnings.
Completed in 3.598s at Thu Mar 05 2015 12:21:35 GMT+0100 (Hora estándar romance)

  • Waiting...

I have package.json as follows:
{
"name": "foundationpress",
"version": "5.5.1",
"devDependencies": {
"node-sass" : "~0.9.6",
"grunt": "~0.4.1",
"grunt-contrib-watch": "~0.5.3",
"grunt-sass": "~0.17.0",
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-uglify": "~0.2.7",
"grunt-string-replace": "~0.2.7"
},
"repository" : {
"type" : "git",
"url" : "https://github.com/olefredrik/FoundationPress.git"
}
}

Please help, before I have to go back to CSS and Cut and Paste!

@jesstura
Copy link

jesstura commented Mar 6, 2015

Working fine about a week ago...but now it is displaying this error:

npm ERR! [email protected] install: 'node scripts/install.js'
npm ERR! spawn ENOENT...

Also, when i do the

nvmw use v0.10.33

"C:\Users...\AppData\Roaming\npm\node_modules\nvmw...." install v0.10.33 'reg' is not recognized as an internal or external command,....

This is kind of frustrating now. Time supposedly spent with the web development is now spent to this frustrating errors. I really like FoundationPress and the use of SASS instead of vanilla CSS.

Is there any better alternative so we can still enjoy FoundationPress and SASS, with less of these unstable issues?

Thanks for any input. I'm using wamp, win7 (x64).

@maggy96
Copy link

maggy96 commented Mar 21, 2015

@olefredrik 👍

@traang
Copy link

traang commented Sep 16, 2015

@Strutsagget
Thanks so much! Your suggestion to upgrade grunt-sass and node-sass worked like a charm! Very glad now!

@peterstouw
Copy link

Trying to get FoundationPress (version < 1.5) running on my old MacBook Pro, I never saw so many error messages.
At some point I also got the sass errors
Loading "sass.js" tasks...ERROR

Error: libsass bindings not found in /Applications/MAMP/htdocs/siteurl/wp-content/themes/FoundationPressMaster14/node_modules/node-sass/vendor/darwin-x64-46/binding.node. Try reinstalling node-sass?
Warning: Task "sass" not found. Use --force to continue.
Aborted due to warnings.

I decided to do the following after looking into the error message created by
npm install node-sass
and
npm install grunt-sass

Install grunt-sass & node-sass globally

run
npm install -g node-sass
to create a working node-sass in /usr/local/lib/node_modules/node-sass

run
npm install -g grunt-sass
to create a working grunt-sass in /usr/local/lib/node_modules/grunt-sass

delete or rename the node_modules directory from your development environment
/Applications/MAMP/htdocs/testurl/wp-content/themes/FoundationPressVersionX/node_modules

go to your foundationpress directory
ls -al
if node_modules is there then delete it
rm -rf node_modules

run
npm update
or
npm install
This will creates a new node_modules directory in your development environment, with a faulty grunt-sass & node-sass.

Then go to your globally installed grunt-sass & node-sass
copy (not move)
/usr/local/lib/node_modules/node-sass
to
/Applications/MAMP/htdocs/testurl/wp-content/themes/FoundationPressVersionX/node_modules

copy (not move)
/usr/local/lib/node_modules/grunt-sass
to
/Applications/MAMP/htdocs/testurl/wp-content/themes/FoundationPressVersionX/node_modules

run
grunt build

run
grunt

change a .scss file and save it and sass will run.

By the way, the new 1.5 version of FoundationPress did work ok.
npm install and grunt build worked without errors.

@arielnoname
Copy link

Well, had the same problem today. Only worked with a clean FoundationPress install using node 0.10.33. If you installed FP with another version, it'll get messy.

My recommended fix for Mac:

On terminal:

Install Homebrew
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install nvm (Node Version Manager)
$ brew install nvm

Install and use v0.10.33
$ nvm install 0.10.33
$ nvm use 0.10.33

Install FoundationPress
$ cd my-wordpress-folder/wp-content/themes/
$ git clone https://github.com/olefredrik/FoundationPress.git
$ cd FoundationPress
$ npm install

Run watch and be happy
$ npm run watch

Hope this helps.

@Epyon616
Copy link

I found this error myself earlier today and after much frustration and hair pulling, I finally think I have found the source of this problem (at least on Mac OS) It turned out that after updating to El Capitan I had not reinstalled Xcode and the command line tools that go with it. So I went back waited for Xcode to download and installing this error finally went away.

@sushilkumaryogi
Copy link

sudo gem clean
sudo gem install foundation
sudo npm install -g bower grunt-cli
sudo npm install
grunt build
grunt / grunt serve / grunt watch

These commend is really working..

thanks for share.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests