Amarat
Amarat

Reputation: 630

Error: Cannot find module '../lib/utils/unsupported.js' on window10

When I install any npm pakages such as: npm i lodash, npm i bcrypt, etc..., it errors like this:

Error: Cannot find module '../lib/utils/unsupported.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
    at Function.Module._load (internal/modules/cjs/loader.js:506:25)
    at Module.require (internal/modules/cjs/loader.js:636:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:19:21
    at Object.<anonymous> (C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:153:3)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
internal/modules/cjs/loader.js:582
    throw err;

Upvotes: 2

Views: 5121

Answers (3)

maksimov
maksimov

Reputation: 5811

Version of the accepted answer adapted to OSX:

rm -rf /usr/local/lib/node_modules
brew reinstall node

Upvotes: 3

Amarat
Amarat

Reputation: 630

Try this

  1. Rename the nodejs folder "C:\Program Files\nodejs"
  2. Install node current stable version from https://nodejs.org/en/ again

Upvotes: 1

saulotoledo
saulotoledo

Reputation: 1982

Try removing the folder %USERPROFILE%\AppData\Roaming\npm\ and using your commands again. You may need to reinstall node.

Upvotes: 1

Related Questions