npm Cannot find module ‘inherits’

  javascript, node.js, npm

Upon updating to a newer version of Node, whenever I try to use npm this error is returned.

I’ve tried uninstalling and reinstalling Node with their Windows Installer Package but nothing changed.

When checking node -v it returns the latest version of v14.15.3, and I’m using the command prompt from my desktop.

internal/modules/cjs/loader.js:883
  throw err;
  ^

Error: Cannot find module 'inherits'
Require stack:
- C:UsersRoger's LaptopAppDataRoamingnpmnode_modulesnpmnode_modulesreadable-streamlib_stream_readable.js
- C:UsersRoger's LaptopAppDataRoamingnpmnode_modulesnpmnode_modulesreadable-streamreadable.js
- C:UsersRoger's LaptopAppDataRoamingnpmnode_modulesnpmnode_modulesnpmlognode_modulesare-we-there-yettracker-stream.js
- C:UsersRoger's LaptopAppDataRoamingnpmnode_modulesnpmnode_modulesnpmlognode_modulesare-we-there-yettracker-group.js
- C:UsersRoger's LaptopAppDataRoamingnpmnode_modulesnpmnode_modulesnpmlognode_modulesare-we-there-yetindex.js
- C:UsersRoger's LaptopAppDataRoamingnpmnode_modulesnpmnode_modulesnpmloglog.js
- C:UsersRoger's LaptopAppDataRoamingnpmnode_modulesnpmbinnpm-cli.js
[90m    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)[39m
[90m    at Function.Module._load (internal/modules/cjs/loader.js:725:27)[39m
[90m    at Module.require (internal/modules/cjs/loader.js:952:19)[39m
[90m    at require (internal/modules/cjs/helpers.js:88:18)[39m
    at Object.<anonymous> (C:UsersRoger's LaptopAppDataRoamingnpmnode_modules[4mnpm[24mnode_modules[4mreadable-stream[24mlib_stream_readable.js:68:17)
[90m    at Module._compile (internal/modules/cjs/loader.js:1063:30)[39m
[90m    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)[39m
[90m    at Module.load (internal/modules/cjs/loader.js:928:32)[39m
[90m    at Function.Module._load (internal/modules/cjs/loader.js:769:14)[39m
[90m    at Module.require (internal/modules/cjs/loader.js:952:19)[39m {
  code: [32m'MODULE_NOT_FOUND'[39m,
  requireStack: [
    [32m"C:UsersRoger's LaptopAppDataRoamingnpmnode_modulesnpmnode_modulesreadable-streamlib_stream_readable.js"[39m,
    [32m"C:UsersRoger's LaptopAppDataRoamingnpmnode_modulesnpmnode_modulesreadable-streamreadable.js"[39m,
    [32m"C:UsersRoger's LaptopAppDataRoamingnpmnode_modulesnpmnode_modulesnpmlognode_modulesare-we-there-yettracker-stream.js"[39m,
    [32m"C:UsersRoger's LaptopAppDataRoamingnpmnode_modulesnpmnode_modulesnpmlognode_modulesare-we-there-yettracker-group.js"[39m,
    [32m"C:UsersRoger's LaptopAppDataRoamingnpmnode_modulesnpmnode_modulesnpmlognode_modulesare-we-there-yetindex.js"[39m,
    [32m"C:UsersRoger's LaptopAppDataRoamingnpmnode_modulesnpmnode_modulesnpmloglog.js"[39m,
    [32m"C:UsersRoger's LaptopAppDataRoamingnpmnode_modulesnpmbinnpm-cli.js"[39m
  ]
}

Source: Ask Javascript Questions

LEAVE A COMMENT