gulp primordials is not defined
Asked Answered
U

1

1

I am getting this error when I try to run Gulp from the task runner I think its related to me updating my npm project but I am not sure how to fix it. Do I need to install a different version of npm?

>Failed to run "C:\WebProjects\ITF\Tool.Web\Gulpfile.js"...
cmd.exe /c gulp --tasks-simple
fs.js:47
} = primordials;
^

ReferenceError: primordials is not defined at fs.js:47:5

C:\WebProjects\ITF\Tool.Web>npm ls natives
[email protected] C:\WebProjects\ITF\Tool.Web
`-- [email protected]
  `-- [email protected]
    `-- [email protected]
      `-- [email protected]

Version

C:\WebProjects\ITF\Tool.Web>npm -v
8.5.5
Unzip answered 7/4, 2022 at 18:50 Comment(1)
Does this answer your question? How to fix "ReferenceError: primordials is not defined" in Node.jsTaunyataupe
I
2

Judging from your version of npm, you seem to be using Node.js 17.8.0, which is currently the latest version. Now, Gulp 3 does not work in any currently maintained version of Node.js (see issue).

You should upgrade to Gulp 4 to fix the error.

Immotile answered 7/4, 2022 at 20:36 Comment(4)
Odd numbered major versions of Node.js become unsupported after 6 months. It may be better to instead use the even numbered 16.x in production, as it will enter long-term support mode later this year whereas 17.x will hit end of life in June. [nodejs.org/en/about/releases/](About Node.js releases)Smelly
@MarkHanna I think I wasn't clear enough. I wasn't suggesting to use Node.js 17.8.0, rather imagining that this was the version used by the OP basing on the information that the npm version is 8.5.5. I reworded my answer to make it clearer.Immotile
Would it be better to downgrade Node.js so Gulp 3 would work? I wouldn’t want to rewrite the gulp script?Unzip
@Unzip It depends, I'd say, on why you updated your project in the first place. Just note that Gulp 3, like Node.js < 12, is no longer maintained.Immotile

© 2022 - 2024 — McMap. All rights reserved.