3

I have a ReactJS project and I was trying to use some of the PrimeReact components. At some point, I faced an error (can't remember exactly which one) and I tried to run an older version of NPM in a copy of my main directory.

Now, I get this error every time, even when I run npm command.

I've already tried to delete my node_modules folder, delete my project and clone it back from GitHub and also to reinstall NodeJS several times. I don't know what to do!

I have Windows 10 and I'm using NodeJS v12.16.0.

Thanks to anyone that offers some help

Update: I have never installed gulp. I suppose that maybe some dependency is using it but, because I can't run any npm command, I can't remove them D:

The error:

C:\Users\Carlos>npm
evalmachine.<anonymous>:35
} = primordials;
    ^

ReferenceError: primordials is not defined
    at evalmachine.<anonymous>:35:5
    at Object.<anonymous> (C:\Users\Carlos\AppData\Roaming\npm\node_modules\npm\node_modules\npm-registry-client\node_modules\graceful-fs\fs.js:12:1)
    at Module._compile (internal/modules/cjs/loader.js:1157:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1177:10)
    at Module.load (internal/modules/cjs/loader.js:1001:32)
    at Function.Module._load (internal/modules/cjs/loader.js:900:14)
    at Module.require (internal/modules/cjs/loader.js:1043:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (C:\Users\Carlos\AppData\Roaming\npm\node_modules\npm\node_modules\npm-registry-client\node_modules\graceful-fs\graceful-fs.js:3:27)
    at Module._compile (internal/modules/cjs/loader.js:1157:30)
Bilaal Rashid
  • 828
  • 2
  • 13
  • 21

1 Answers1

1

It might be an error related with gulp and node v12 conflict. If you have the gulp installed globally in your environment and you can uninstall without problems, you can try it. To help with commands, check if you have the gulp installed, typing this in your command line interface:

gulp -v

Uninstall your version:

npm uninstall -g gulp 
  • Thanks for your answer! unfortunately, no: I have never installed gulp. – Leandro Garcia Luzzi Feb 17 '20 at 00:25
  • Just to add one more thought, you can also try to downgrade your node version using https://github.com/coreybutler/nvm-windows to v11 and check if the problem is related with some conflicts. – Evandro Nogueira Exposto Feb 17 '20 at 00:38
  • Thank you! this was really useful! It was tricky, but I solve it downgrading to version 6.4.0, running the console as Administrator, updating graceful-fs and then upgrading to latest version of npm. Im concerning that the problem was caused by a native module and this was still ocuring even when I was reinstaling NodeJs. Is this happening to anyone downloading NodeJs right now? Anyway, it is solve! Thank you very much! – Leandro Garcia Luzzi Feb 17 '20 at 02:28
  • The problem is related with a graceful-fs conflict with node, because they patched the fs library and worked before version 12 of node. This lib is a dependency of a lot of libraries, including gulp and because of that, the error can occur. The error is fixed, but sometimes we use global clients outdated and this error can appear. My first assumption was gulp because of that. In your case, was something else. – Evandro Nogueira Exposto Feb 17 '20 at 08:45
  • I thought it was solved, but now I can only use npm running the console as administrator. At least I can work now! I also think the error is related with GULP, I hope it can be solved soon. Thank you for your support! – Leandro Garcia Luzzi Feb 18 '20 at 17:52