Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install both 32 and 64 bit bindings

Tags:

node.js

npm

I am using gulp with Visual Studio to build sass files on Windows. This makes use of libsass which has both 64 and 32 bit bindings.

Visual Studio runs in a 32 bit context, and thus installs and requires the 32 bit libsass. However, when running msbuild from the command line the 64 bit version of libsass is required.

This means I'm constantly getting the error libsass bindings not found in ...\node-sass\vendor\win32-ia32-11\binding.node. Try reinstalling node-sass (or win32-x64-14 after buliding from the command line).

Running npm install from the different contexts does not work because npm thinks the module is already fully installed.

Currently the only solution I've found is to constantly delete the whole node_modules folder and re-install all the packages each time.

Ideally I'd like to install both the 32 and 64 bit packages at the same time.

like image 568
Chris Chilvers Avatar asked Sep 16 '15 08:09

Chris Chilvers


2 Answers

Instead of mixing the 64 and 32 versions, you can configure Visual Studio to always go to your own local installation of node.

In Visual Studio: Go to Tools > Options > Projects and Solutions > External Web Tools and move $(PATH) above $(DevEnvDir)\Extensions\Microsoft\Web Tools\External. Now VS will call your local installation of node instead.

like image 196
Alex Avatar answered Sep 22 '22 03:09

Alex


A workaround that might be helpful is to copy the required binding.node file into an appropriately named folder. The binding.node files can be downloaded on the node-sass releases page .

If you add a subfolder with the name of the binding.node to the vendor folder and then stick the binding.node file (rename it to use this name) in there then it should be found when required.

like image 23
Scott Munro Avatar answered Sep 25 '22 03:09

Scott Munro