Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

After node reinstalled: "Cannot find module 'internal/util/types' "

Tags:

node.js

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)

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?

like image 212
L.C.J Avatar asked Dec 03 '22 11:12

L.C.J


1 Answers

In windows,

  • Step 1: Go to \global_modules\node_modules, (C:\Users\youruser\AppData\Roaming\npm ) (C:\Users\youruser\AppData\Roaming\npm-cache)

  • Step 2: Delete the "npm" folder and all its contents,

  • Step 3: Go to https://nodejs.org,

  • Step 4: Download the "Recommended For Most Users" version),

  • Step 5: Install it

like image 155
Sajeetharan Avatar answered Jan 17 '23 17:01

Sajeetharan