I have Node v14.19.0, NPM v6.14.16 and gulp CLI version 2.3.0 along with the Local version 3.9.1 installed on my Computer (the OS is Ubuntu 22.04).
The issue is, when I run any gulp command I'm getting this error
ReferenceError: primordials is not defined
at fs.js:40:5
at req_ (/home/opera/Desktop/my-site/public/node_modules/natives/index.js:143:24)
at Object.req [as require] (/home/opera/Desktop/my-site/public/node_modules/natives/index.js:55:10)
at Object.<anonymous> (/home/opera/Desktop/my-site/public/node_modules/vinyl-fs/node_modules/graceful-fs/fs.js:1:37)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:101:18)
After going through some answers and trying solutions provided I found one that solves the above issue but unfortunately produces another error.
The solution that worked is Upgrading the gulp version but it comes with another problem and that seems to be some changes in the v4.
What exact version of node and npm works well with gulp 3.9.1?
Gulp 3.9.1 will work with Node 8 (latest noded 8 is 8.17.0) and with nothing newer. It's a dead and unsafe node version. So is the gulp project as a whole (last release in 2019). I could understand if it's a legacy project but using it in new projects should be prosecutable (note: it's my personal opinion only). If you are forced to use it and you have other node version already installed I recommend using nvm to manage multiple node versions on your environment.