npm install – Cannot find module ‘semver’ issue

I have recently got an error “Cannot find module ‘semver'” on my Ubuntu VM when doing npm install.

+ npm install
...
...
module.js:340
    throw err;
          ^
Error: Cannot find module 'semver'

 

I have tried various things but nothing worked out. Then I have done the below things and it resolved my issue.

sudo apt-get remove nodejs

sudo apt-get remove npm

sudo apt-get update 

sudo apt-get install nodejs

sudo apt-get install npm

sudo ln -s /usr/bin/nodejs /usr/bin/node

npm install

 

Advertisements

3 thoughts on “npm install – Cannot find module ‘semver’ issue

  1. Error: Cannot find module ‘semver’
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object. (C:\Users\User\AppData\Roaming\npm\node_modules\npm\lib\utils\unsupported.js:2:14)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s