3

I have just installed node hence i run the node -v and npm -v to confirm that they have successfully been installed. node -v is returning the version of node as expected, however npm -v throws the bellow error. What can be the issue?

module.js:491
    throw err;
^

Error: Cannot find module '../lib/utils/unsupported.js'
    at Function.Module._resolveFilename (module.js:489:15)
    at Function.Module._load (module.js:439:25)
    at Module.require (module.js:517:17)
    at require (internal/module.js:11:18)
    at /usr/local/lib/node_modules/npm/bin/npm-cli.js:19:21
    at Object.<anonymous> (/usr/local/lib/node_modules/npm/bin/npm-
cli.js:92:3)
    at Module._compile (module.js:573:30)
    at Object.Module._extensions..js (module.js:584:10)
    at Module.load (module.js:507:32)
    at tryModuleLoad (module.js:470:12)`
Paul Kahohi
  • 164
  • 1
  • 3
  • 6
  • I got it working. I am guessing its something to do with installing node via brew. I did a `brew uninstall node` then downloaded node from the [official node site](https://nodejs.org/en/) and vuallaaa... it worked – Paul Kahohi Sep 12 '17 at 09:17
  • 1
    Does this answer your question? [internal/modules/cjs/loader.js:582 throw err](https://stackoverflow.com/questions/53545800/internal-modules-cjs-loader-js582-throw-err) – Henke Jul 05 '20 at 15:34

1 Answers1

1

It might be a permissions problem, delete your local/lib/node_modules folder and reinstall node. For further info, you might wanna check out this error resolved on npm's github discussion.

Milan Velebit
  • 1,933
  • 2
  • 15
  • 32