How to fix “ReferenceError: primordials is not defined” error.

Share This Post

Are You Facing ReferenceError: primordials is not defined Error when trying to run gulp? Maybe you’re on gulp v3 and node v12, and that’s the source of the issue.

The thing is, gulp v3 doesn’t work (as of now) under node v12, because it depends on [email protected]^3.0.0 which patches Node’s fs module and that patch worked before node v12 just fine.

Solution for ReferenceError: primordials is not defined:

1. upgrade gulp to v4 . This Solution Will Solve Your Error.

2. To downgrade Node to v11 To Solve This Error.

3. To pin graceful-fs to version 4.2.2 that’s known to work under Node v12 – That Option Explained Below This Option Is Worked for me So I recommend you this Option.

Here Is Example Of Option 3:

1. First of All Find Your package.json and in the same directory create an npm-shrinkwrap.json file with the following contents

  "dependencies": {
    "graceful-fs": {
        "version": "4.2.2"

2. Now, Just Run npm install. it will update npm-shrinkwrap.json with a bunch of content.

It will solve Your Error.

Also Look Our Forum Question Answer For ReferenceError: primordials is not defined


Leave a Reply

Your email address will not be published. Required fields are marked *