最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - npm ReferenceError: primordials is not defined (node.js) - Stack Overflow

programmeradmin5浏览0评论

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._pile (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._pile (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 mand line. I don't understand how it is not visible.

Thank you.

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._pile (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._pile (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 mand line. I don't understand how it is not visible.

Thank you.

Share Improve this question asked Jul 14, 2020 at 14:56 pigwidgeonpigwidgeon 2101 gold badge4 silver badges11 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 2

It is resolved!

I know I said I uninstalled npm, but just uninstalling it from the settings were not enough. I tried to uninstall it deleting the node releted directories on my puter following this post: https://stackoverflow./a/11178106/13806114. And then I installed node again and it worked!

Thank you.

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

发布评论

评论列表(0)

  1. 暂无评论