How to fix primordials is not defined

This primordials issue occurs when you have some different version for gulp and node. If you are using node 12 and gulp 3, then this problem happen while you automate your task.

Here is the quick solution for you.

If you are using yarn then add below snippet for in you package.json file and install that package through yarn.

{
  // Your current package.json contents
  "resolutions": {
    "graceful-fs": "^4.2.4"
  }
}

After install this package through yarn, Now you can run your automation command.

Another Solution

If you are using node > 14 and with gulp > 3 then below solution might be helpful for you.

If the above solution doesn’t work, then you can create a file and name it npm-shrinkwrap.json at the root of you project where you have package.json. In the file put below content.

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

Now run npm install. It will update npm-shrinkwrap.json file with a bunch of content.

Once it install all the dependency then you can run yarn / gulp command from your terminal.