问题描述
我正在学习 Redux,并且在我的初始项目设置期间尝试安装节点包的任何时候都会遇到此错误:
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)`
我看到有类似的线程提供了解决方案,但是没有一个线程为我解决了这个问题.我尝试过的两个选项:1) npm install node v6.2.2 (一线程推荐回滚node版本)2) npm 重建
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
但是,我运行的任何npm"命令都会引发完全相同的错误.有没有人遇到过这个问题?
However, any 'npm' command I run simply throws the exact same error. Has anyone encountered this issue before?
提前致谢.
推荐答案
尝试 npm cache clean --force 并重新安装.如果这不起作用,请尝试删除 node_modules 文件夹并再次运行 npm install.
Try npm cache clean --force and install again. If that doesn't work, try deleting the node_modules folder and run npm install again.
这篇关于“错误:找不到模块‘内部/实用程序/类型’";在 react-redux 项目中安装节点包时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!