节点重新安装后:“找不到模块‘内部/实用程序/类型’" [英] After node reinstalled: "Cannot find module 'internal/util/types' "
问题描述
所以几个月前我从我的计算机中删除了节点(主要是我认为),今天我重新安装了它.Node 工作正常,但是当我尝试测试 npm 时,我收到以下消息:
So I had removed node from my computer (mostly, I thought) a couple months ago, and today I reinstalled it. Node's working okay, but when I try to test npm I get this message:
$ npm
module.js:549
throw err;
^
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> (C:\Users\LG\AppData\Roaming\npm\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)
正如我所看到的那样,我尝试使用npm rebuild",但这对任何事情都没有影响.我在 Windows 上使用 Node v8.11.2(如果我知道 NPM 的版本,那该死).有什么线索吗?
I tried using "npm rebuild" as I've seen suggested, but that has no impact on anything. I'm using Node v8.11.2 on Windows (hell if I know what version of NPM). Any clues?
推荐答案
在 windows 中,
In windows,
步骤 1:转到
\global_modules\node_modules,
(C:\Users\youruser\AppData\Roaming\npm )(C:\Users\youruser\AppData\Roaming\npm-cache)
Step 1: Go to
\global_modules\node_modules,
(C:\Users\youruser\AppData\Roaming\npm ) (C:\Users\youruser\AppData\Roaming\npm-cache)
第 2 步:删除 "npm"
文件夹及其所有内容,
Step 2: Delete the "npm"
folder and all its contents,
第 3 步:转到 https://nodejs.org
,
Step 3: Go to https://nodejs.org
,
第 4 步:下载推荐给大多数用户"版本),
Step 4: Download the "Recommended For Most Users" version),
第五步:安装
这篇关于节点重新安装后:“找不到模块‘内部/实用程序/类型’"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!