Questions tagged [gulp-sass]

a gulp plugin for compilation of Sass to CSS.

gulp-sass is a gulp plugin for compilation of Sass files to CSS files.

Basic example of usage:

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

gulp.task('sass', function () {
  gulp.src('./sass/**/*.scss')
    .pipe(sass().on('error', sass.logError))
    .pipe(gulp.dest('./css'));
});

The plugin can also be used with gulp-sourcemaps:

var gulp = require('gulp');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');

gulp.task('sass', function () { 
  gulp.src('./sass/*.scss')
    .pipe(sourcemaps.init())
    .pipe(sass())
    .pipe(sourcemaps.write('./sourcemaps'))
    .pipe(gulp.dest('./css'));
});

gulp-sass accepts node-sass compatible options, e.g.:

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

gulp.task('sass', function () {
  gulp.src('./sass/**/*.scss')
    .pipe(sass({ outputStyle: 'compressed' }))
    .pipe(gulp.dest('./css'));
});
749 questions
876
votes
44 answers

How to fix "ReferenceError: primordials is not defined" in Node.js

I have installed Node.js modules by 'npm install', and then I tried to do gulp sass-watch in a command prompt. After that, I got the below response. [18:18:32] Requiring external module babel-register fs.js:27 const { Math, Object, Reflect } =…
Ramesh
  • 8,921
  • 3
  • 18
  • 14
231
votes
34 answers

Node Sass does not yet support your current environment: Linux 64-bit with false

Getting this error on Arch Linux with node-sass. I'm using it with gulp-sass. Node Sass does not yet support your current environment: Linux 64-bit with false Versions $ gulp -v [19:43:15] CLI version 3.9.1 [19:43:15] Local version 3.9.1 $ npm…
Jitendra Vyas
  • 148,487
  • 229
  • 573
  • 852
158
votes
20 answers

Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (88)

I have tried to install gulp-sass latest version with npm i gulp-sass --save-dev in the begining I got a lot of errors but later solved them. But whenever I try to run gulp I got this error: Error: Node Sass does not yet support your current…
DINA TAKLIT
  • 7,074
  • 10
  • 69
  • 74
108
votes
4 answers

How to compile or convert sass / scss to css with node-sass (no Ruby)?

I was struggling with setting up libsass as it wasn't as straight-forward as the Ruby based transpiler. Could someone explain how to: install libsass? use it from command line? use it with task runners like gulp and grunt? I have little experience…
Thoran
  • 8,884
  • 7
  • 41
  • 50
102
votes
5 answers

Task Runner Explorer can't load tasks

I'm using VS2015 and Gulp. I open the Task Runner Explorer and hit refresh, and this shows up in the log: Failed to run "C:\Projects\Test\Gulpfile.js"... cmd.exe /c gulp --tasks-simple Error: `libsass` bindings not found in…
Josh M.
  • 26,437
  • 24
  • 119
  • 200
88
votes
13 answers

Node Sass with apple m1, Big Sur and arm64

Error: Node Sass does not yet support your current environment: OS X Unsupported architecture (arm64) with Unsupported runtime (93) For more information on which environments are supported please see: …
user1272597
  • 1,215
  • 3
  • 12
  • 15
69
votes
8 answers

cannot find module "lodash"

Today I tried to learn more about Google Web Starter Kit so I followed these instructions and after a lot of fight and problem I just tried to start a local server (the first task we’ll look at is: $ gulp serve.) and received this…
Bosko Skrbina
  • 713
  • 1
  • 5
  • 5
60
votes
11 answers

Gulpjs combine two tasks into a single task

I currently have two tasks, that both compile sass files. I would still like to concat the two directories into separate files but it seems that it would be more maintainable if I could simply create a 'sass' task that would be responsible for all…
Noah Goodrich
  • 24,875
  • 14
  • 66
  • 96
56
votes
4 answers

Have sass-lint ignore a certain line?

I'm using sass-lint with Gulp. How can I disable warnings for a particular style in my sass from the lint console output? I've found a similar question but I'm using sass-lint, not scss-lint: Having scss-lint ignore a particular line This is the…
Evanss
  • 23,390
  • 94
  • 282
  • 505
45
votes
1 answer

Underscore in partial Sass file

Is it necessary to have a .scss partial file start with an underscore? The documentation states that a partial should start with an underscore, because the file would otherwise compile to a CSS file. However I've noticed gulp-sass compiles files…
Squrler
  • 3,444
  • 8
  • 41
  • 62
40
votes
4 answers

Gulp condition inside pipe

How can I do a condition inside Gulp pipe to output to a different destination. g.task('sass', function() { return g.src(sources.sass).pipe(changed(output.css)).pipe(sass({ style: 'compressed', sourcemap: true })).pipe(function() { …
max li
  • 2,417
  • 4
  • 30
  • 44
37
votes
4 answers

ReferenceError: require is not defined in ES module scope, you can use import instead gulp sass

I got an error when using this line of code const sass = require('gulp-sass')(require('sass')); The error output is : Requiring external module babel-register ReferenceError: require is not defined in ES module scope, you can use import…
askcoder
  • 513
  • 1
  • 5
  • 8
36
votes
8 answers

cannot read property 'apply' of undefined gulp

I am trying to use the ng-factory generator to scaffold a new project to build an angularjs component. After the project has been created with the yo ng-factory command, I tried to run it using the gulp serve task but found the following…
atul kale
  • 361
  • 1
  • 3
  • 4
32
votes
1 answer

Gulp doesn't work

I installed gulp on my machine, but when i try to compile my project i have this error: Error: Cannot find module 'del' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require…
user3519727
  • 361
  • 2
  • 4
  • 10
31
votes
6 answers

gulp-sass 5 does not have a default Sass compiler; please set one yourself

Error in plugin "gulp-sass" Message: gulp-sass 5 does not have a default Sass compiler; please set one yourself. Both the sass and node-sass packages are permitted. For example, in your gulpfile: var sass =…
Zia Ansari
  • 343
  • 1
  • 3
  • 6
1
2 3
49 50