npm ReferenceError: primordials is not defined (node.js)

I know this question is posted many times but I tried the solutions and I can not resolve it. I am trying to work wit npm however I get this error:

     evalmachine.<anonymous>:35     } = primordials;         ^          ReferenceError: primordials is not defined         at evalmachine.<anonymous>:35:5         at Object.<anonymous> (C:\Users\User\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\fs.js:11:8)         at Module._compile (internal/modules/cjs/loader.js:1138:30)         at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)         at Module.load (internal/modules/cjs/loader.js:986:32)         at Function.Module._load (internal/modules/cjs/loader.js:879:14)         at Module.require (internal/modules/cjs/loader.js:1026:19)         at require (internal/modules/cjs/helpers.js:72:18)         at Object.<anonymous> (C:\Users\User\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:3:27)         at Module._compile (internal/modules/cjs/loader.js:1138:30) 

I can not even execute npm -v to see the version. I tried to downgrade node to version 10. I tried to uninstall-reinstall node so many times (From remove application settings). I tried to create a file called "npm-shrinkwrap.json" insde the npm folder where package.json exists. But there is no use.

And I can’t see an "AppData" folder in the "Users/User" path but I can access it by "cd" from the command line. I don’t understand how it is not visible.

Thank you.

Add Comment
1 Answer(s)

It’s looking for the "primordials" method in graceful-fs, trying to reinstall this dependency.

About npm, try reinstalling nodejs again, probably your npm is corrupted

About AppData is not visible or is a hidden directory in Windows, you can access it by path in Windows Explorer

Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.