Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to install node-sass without downloading from Github during the post install step?

I'm behind a corporate firewall, proxying the npm repository with Nexus. During the post install step, node-sass tries to curl from https://github.com/sass/node-sass/releases/download/v3.10.1/linux-x64-48_binding.node but fails due to the firewall. Adding a firewall rule to let the request get through is not an option. If it's possible to also proxy Github through Nexus, that may be an option but I haven't been able to get that configuration working when I've tried.

This is also for a Jenkins build, so having the developer do a npm rebuild node-sass after the failed install is not an option. I need the install to work, or the Jenkins build will fail.

Is there any way to install node-sass from just the npm registry without also having to download anything from other sources during the post-install step?

like image 716
A. Duff Avatar asked Oct 21 '16 14:10

A. Duff


People also ask

How do I know if Sass is installed?

To check the version, run the command: sass –version. The latest version is 1.49.

How do I install Sass globally?

You can install Sass globally using npm install -g sass which will provide access to the sass executable. You can also add it to your project using npm install --save-dev sass . This provides the executable as well as a library: const sass = require('sass'); const result = sass.

Which is better Sass or node sass?

node-sass and Sass are both open source tools. It seems that Sass with 12K GitHub stars and 1.93K forks on GitHub has more adoption than node-sass with 6.49K GitHub stars and 949 GitHub forks.

What is npm install node sass?

Node-sass is a library that provides binding for Node. js to LibSass, the C version of the popular stylesheet preprocessor, Sass. It allows you to natively compile . scss files to css at incredible speed and automatically via a connect middleware. Find it on npm: https://www.npmjs.com/package/node-sass.


1 Answers

You can install the the node-sass using

npm install node-sass --sass-binary-site=http://example.com/ or
npm install node-sass --sass-binary-path=<your binary file>

the binary file can be downloaded from github.

Or you can add the flowing line to .npmrc

# change the /home/wangxiang/linux-x64-72_binding.node to your real path
sass_binary_path=/home/wangxiang/linux-x64-72_binding.node

and then:

npm install node-sass
like image 186
ramwin Avatar answered Oct 18 '22 13:10

ramwin