1

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'
    ])
})
Tenusha Guruge
  • 2,147
  • 3
  • 18
  • 38
noviceDev
  • 27
  • 4
  • Looks like a duplicate of https://stackoverflow.com/questions/55921442/how-to-fix-referenceerror-primordials-is-not-defined-in-node but the solution there is update to Gulp 4, which you already have. I'd probably try Node 10 (the LTS release) and see if that helps. – antonyh Jun 17 '19 at 13:15
  • as you mentioned, I have tried downgrading to Node version 10.16.0. but still the same error and even i got a new error with npm start. – noviceDev Jun 17 '19 at 13:49
  • npm ERR! missing script: start this is the new error: npm ERR! A complete log of this run can be found in: npm ERR! /home/user/.npm/_logs/2019-06-17T13_24_34_080Z-debug.log – noviceDev Jun 17 '19 at 13:50
  • I have figured out the npm start errors. but still problem with gulp. – noviceDev Jun 17 '19 at 13:57

1 Answers1

0

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.

antonyh
  • 2,131
  • 2
  • 21
  • 42
  • 1
    thanks for your answer. although i have't fixed the error yet, but i am going take a look at the package.lock.json file. – noviceDev Jun 17 '19 at 13:47
  • Good luck, I hope this helps. Please update here as it will help others if they have similar problems. – antonyh Jun 25 '19 at 23:00