Ola Karlsson
Ola Karlsson

Reputation: 9203

How can I find out what version of Sass I'm using when running gulp-sass?

I just started using gulp-sass, is there a "easy" way to find out what version of Sass, that is being used?

Not that I think it matters too much but I'm using gulp-sass in Visual Studio 2015 (CTP6).

I need to know because I want to use a Sass mixin which requires a certain minimum version of Sass.

At the moment, if I want to find out what version of Sass is being used, I try to follow the trail like this, gulp-sass is a wrapper for node-sass which in its turn is providing Node bindings for libsass, which is a C compiler for Sass.

So to find out the version of Sass being used in my environment, I have to follow the chain and try to work out which version is used in each step and what version it then uses of the next step.

Surely there must be an easier way?

Upvotes: 5

Views: 14559

Answers (4)

LReeder14
LReeder14

Reputation: 618

At a cmd prompt, you can try node-sass -version

cmd: node-sass -version
node-sass       4.14.1  (Wrapper)       [JavaScript]
libsass         3.5.5   (Sass Compiler) [C/C++]

Upvotes: 0

Oleksiï Nikonov
Oleksiï Nikonov

Reputation: 5598

You may find out Sass version in Node-sass right from the terminal by the next line

node -e 'console.log(require("node-sass").info)'

Upvotes: 3

romuleald
romuleald

Reputation: 1444

Look in your node_modules/grunt-sass/node_modules/node-sass/package.json

"libsass": "version"

Upvotes: 2

Mekap
Mekap

Reputation: 2085

We can agree that, from node-sass you can get the versions using :

var sass = require('node-sass');

console.log(sass.info);

From gulp-sass, you can send data which will be executed by node-sass. So something like this should do the trick :

var gulp = require('gulp');
var sass = require('gulp-sass'); 
console.log(sass.info);

It's going to be the .info() from node-sass who get's called in the end, giving you both it's version and libsass's version.

Upvotes: 2

Related Questions