0

I'm trying to run Gulp on a project but am getting the error ReferenceError: primordials is not defined.

The package did use Gulp 3 so I updated to Gulp 4. But I still get the error.

For Gulp my versions are:

CLI version: 2.3.0
Local version: 4.0.2

For Node:

v12.18.3

My Gulp file is simple:

var gulp = require('gulp');
var less = require('gulp-less');
var path = require('path');

gulp.task('less', async function () {
    gulp.src('css/less/app.less')
    .pipe(less({
        paths: [ path.join(__dirname, 'less', 'includes') ]
    }))
    .pipe(gulp.dest('css/'));
});

gulp.task('watch', async function () {
    gulp.watch(['css/less/*.less', 'css/less/_*.less'], gulp.series('less'));
});

Would anyone know what I could do?

MeltingDog
  • 14,310
  • 43
  • 165
  • 295
  • 1
    Here are two of the better answers: https://stackoverflow.com/a/60136898/836330 and https://stackoverflow.com/a/60921145/836330 – Mark Mar 11 '21 at 04:26

1 Answers1

0

You need downgrade node version to 6. There is a nice tool: NVM - Node Version Manager - it's allow to change node version on the fly.

https://github.com/nvm-sh/nvm

Daniel
  • 2,621
  • 2
  • 18
  • 34