Sign Up

Sign In

Forget Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

You must login to ask question.

How to fix ReferenceError: primordials is not defined in node

  • 2

I am Having issue In Node Js
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
Share This Post
Share
  1. Hi!!
    Removing the depreciated package gulp-utils solved the issue for me.

    A few questions:

    • When you run npm update or npm install do you see anything related to a deprecated package?
    • Are you using the sequelize-cli package?
    • What command are you running that result in ReferenceError: primordials is not defined

    If you have a link to the repo I would love to look into it as well!

    • 0
  2. Cause of problem:

    This problem occurs due to the incompatibility between node and gulp versions. Node version 12 and gulp version 4 does not work together and all these primordial issues pop up.

    Solution:

    You either need to upgrade the gulp version or downgrade the node version. An easy fix is to downgrade node to version 11.15.0. This works without any issues.

    • 0
  3. 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
    • 0
  4. 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.

    • 0
Leave an answer

Leave an answer

Browse

close