Trying to complie sass with elixir and gulp but I when i try gup in terminal, get this error:

334 Views Asked by At

I'm using laravel elixir and gulp to compile my sass files. but when i write gulp in termial I get this error.

fs.js:27
const { Math, Object } = primordials;
                         ^

ReferenceError: primordials is not defined
    at fs.js:27:26
    at req_ (/home/user/Videos/projetct-folder/project/node_modules/natives/index.js:143:24)
    at Object.req [as require] (/home/user/Videos/projetct-folder/projetct/node_modules/natives/index.js:55:10)
    at Object.<anonymous> (/home/user/Videos/projetct-folder/projetct/node_modules/laravel-elixir-livereload/node_modules/graceful-fs/fs.js:1:37)
    at Module._compile (internal/modules/cjs/loader.js:774:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10)
    at Module.load (internal/modules/cjs/loader.js:641:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Module.require (internal/modules/cjs/loader.js:681:19)
    at require (internal/modules/cjs/helpers.js:16:16)

Node version: 12.4.0

gulp CLI version: 2.2.0

gulp Local version: 4.0.2

gulpfile.js:

var elixir = require('laravel-elixir');
require('laravel-elixir-livereload');


elixir.config.assetsPath = 'themes/project/assets/';
elixir.config.publicPath = 'themes/project/assets/compiled/';

elixir(function(mix){

    mix.sass('agency.scss');

    mix.scripts([
        'jqBootstrapValidation.js',
        'agency.js',
        'contact_me.js',
        'recherche.js'
    ]);

    mix.livereload([
        'themes/project/assets/compiled/css/agency.css',
        'themes/project/**/*.htm',
        'themes/project/assets/compiled/js/*.js'
    ])
})
1

There are 1 best solutions below

2
antonyh On

Judging by this bug report for Gulp, it's possible that one of the dependencies is using Gulp 3

one of the packages in your project is likely to be requiring gulp 3. If you inspect your package-lock.json which contains the list of installed packages, you should be able to sort it out.

It specifically mentions the graceful-fs module.