Gulp, Gulp Watch problem

i have been trying to work on new sage with gulp but i am having the problem while compiling sass and js files.

when i run “gulp”, “gulp watch” or “gulp --production” i get the following error.

aamers-imac:sage USERNAME$ gulp watch
  var nodePath = process.env['NODE_PATH'];
Error: dlopen(/Users/USERNAME/Desktop/sage/node_modules/node-sass/vendor/darwin-x64-14/binding.node, 1): no suitable image found.  Did find:
    /Users/USERNAME/Desktop/sage/node_modules/node-sass/vendor/darwin-x64-14/binding.node: truncated mach-o error: segment __TEXT extends to 1159168 which is past end of file 138800
    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.<anonymous> (/Users/USERNAME/Desktop/sage/node_modules/node-sass/lib/index.js:16: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)
aamers-imac:sage USERNAME$ 

i have following versions installed in my imac.

aamers-imac:sage USERNAME$ node -v
aamers-imac:sage USERNAME$ npm -v
aamers-imac:sage USERNAME$ gulp -v
[02:06:54] CLI version 3.9.0
[02:06:54] Local version 3.9.0
aamers-imac:sage USERNAME$ bower -v
aamers-imac:sage USERNAME$ php -v
PHP 5.5.29 (cli) (built: Sep  9 2015 00:26:40) 
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
aamers-imac:sage USERNAME$

Most solutions for errors like those are just re-installing all your node modules and starting from scratch. I’d also suggest using a new Node.js version. We recommend installing through nvm.

1 Like

thank you so much for your reply, I was using the latest version of node.js and after reading the doc node.js >= 0.12.x i uninstalled and reinstalled the 0.12.9

i am going to follow your instructions. I hope it will help. thank you again. :smi+1:

wao…! man it worked. thanks a lot. you save a my day. cheers.