Warm tip: This article is reproduced from stackoverflow.com, please click
node.js sass gulp gulp-sass

How to fix ReferenceError: primordials is not defined in node

发布于 2020-03-31 22:55:36

I have installed node modules by npm install, then I tried to do gulp sass-watch in command prompt. After that I got the below response.

[18:18:32] Requiring external module babel-register
fs.js:27
const { Math, Object, Reflect } = primordials;
                                  ^

ReferenceError: primordials is not defined

Have tried this before gulp sass-watch

npm -g install gulp-cli
Questioner
Ramesh
Viewed
146
2019-05-06 23:16

I hit the same error. I suspect you're using node 12 and gulp 3. That combination does not work: https://github.com/gulpjs/gulp/issues/2324

A previous workaround from Jan. does not work either: https://github.com/gulpjs/gulp/issues/2246

Solution: Either upgrade to gulp 4 or downgrade to an earlier node.