1

I know this may seem like a duplicate to these: Try reinstalling `node-sass` on node 0.12? And how to uninstall npm modules in node js?

The environment for our team is as follows:

<bitbucket git repo>
    /sourcetree\
<local windows/mac machines>
    \rsync to server/
<ubuntu 14.04 dev server>
     <vhost for each dev via proxy pass to rel. port>

We prefer to handle all the modules via a package.json file, easier to setup a new dev machine.. just a simple npm install.

The problem is this.. when node-sass is pulled down to a local windows machine via npm install then synced down to the dev server we keep getting the error:

Error: libsass bindings not found. Try reinstalling node-sass

But then when the module is rebuilt on the server all is fine :s. As, run on the ubuntu server:

npm rebuild node-sass

But then obv. when the fileset from a dev machine is synced to the server this wipes the rebuilt files and we are back at the error again.

When we try to run the rebuild at the local machine before syncing to the server this does not fix anything.

Although we can exclude the node-sass in the rsync command this means we then have inconsistencies when setting up a dev machine.

Community
  • 1
  • 1
John
  • 4,512
  • 8
  • 48
  • 98

1 Answers1

0

I found a work around, instead of using node-sass I found node-sass-middleware.

https://github.com/sass/node-sass-middleware

app.use('/css', sassMiddleware({
    src: __dirname + '/sass',
    dest: __dirname + '/public/css',
    debug: true,
    outputStyle: 'expanded' /*'compressed',*/
}));

But i still required to run

npm rebuild node-sass

And add an --exclude flag to the rsync command which prevented the node-sass directory from within the node middleware module from messing with whatever npm rebuild actually did.

John
  • 4,512
  • 8
  • 48
  • 98