Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

node-sass installation issue

When I try to install node-sass using npm, I get the following error message:

Cannot download "https://github.com/sass/node-sass/releases/download/v3.13.1/win32-x64-57_binding.node":"

The command I use is:

npm install node-sass --save-dev-

You can see more details in the screenshot below:

installation process

like image 699
Alwin Avatar asked Aug 25 '17 08:08

Alwin


People also ask

Why is node Sass not working?

This problem happens because the version of node-sass that you have installed is no longer compatible with the version of node you are trying to run it with.

Is node Sass deprecated?

Warning: LibSass and Node Sass are deprecated. While they will continue to receive maintenance releases indefinitely, there are no plans to add additional features or compatibility with any new CSS or Sass features. Projects that still use it should move onto Dart Sass.

Why do I have to rebuild node sass?

x This usually happens because your environment has changed since running `npm install`. Run `npm rebuild node-sass` to download the binding for your current environment. To make node-sass available in your source code, npm needs to build the package and create a binding for your environment.


3 Answers

After struggling , finally found exact solution. In node js software folder, node-sass\4.5.0 folder is still created in npm-cache folder. So I download win32-x64-48_binding.node manually, put it in C:\Users\Administrator\AppData\Roaming\npm-cache\node-sass\4.5.0 folder.

And run npm install command, issue resolved.

like image 163
Ravi Maroju Avatar answered Nov 03 '22 00:11

Ravi Maroju


I see you are running node version 8.1.4. You can also check it using node --version in the command prompt.

You'll have to use a version >= v4.5.3 instead because lower versions of node-sass are incompatible with node8. This issue has been reported on their GitHub issue page. You either have to define using v4.5.3 instead or pass the the -g parameter while installing it, which seems to fetch the latest version automagically.

when i used -g it worked properly and got the latest version

Also, as @javiergarval has pointed out, you have a typo. It should have been --save-dev instead of --save-dev-.

like image 37
Nico Van Belle Avatar answered Nov 02 '22 23:11

Nico Van Belle


My problem is, that I need an older node-sass Binary, which is not available for the new node version I have. But the solution is, at least on Windows, pretty simple. Just install the windows build tools. With that, npm is able to build the binaries out of the source.

Long story short, this solved the problem for me:

npm install --global --production windows-build-tools

Thanks to the answer on this question: node-sass installation issue on windows 10

like image 22
emonkey Avatar answered Nov 03 '22 00:11

emonkey