“Error: Cannot find module 'internal/util/types'” while installing node packages in a react-redux project

可紊 提交于 2020-02-04 06:21:21

问题


I am learning Redux and am running into this error anytime I try to install a node package during my initial project setup:

`Error: Cannot find module 'internal/util/types'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at evalmachine.<anonymous>:31:26
    at Object.<anonymous> 
(/usr/local/lib/node_modules/npm/node_modules/graceful-fs/fs.js:11:1)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)`

I see there are similar threads providing solutions, however none of those solved this problem for me. Two options I have tried: 1) npm install node v6.2.2 (one thread recommended reverting node version) 2) npm rebuild

However, any 'npm' command I run simply throws the exact same error. Has anyone encountered this issue before?

Thanks in advance.


回答1:


Try npm cache clean --force and install again. If that doesn't work, try deleting the node_modules folder and run npm install again.



来源:https://stackoverflow.com/questions/52731038/error-cannot-find-module-internal-util-types-while-installing-node-packages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!