close

[Solved] Npm install cannot find module ‘semver’

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Npm install cannot find module ‘semver’ in javascript. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Npm install cannot find module ‘semver’ Error Occurs?

Today I get the following error Npm install cannot find module ‘semver’ in javascript.

How To Solve Npm install cannot find module ‘semver’ Error ?

  1. How To Solve Npm install cannot find module 'semver' Error ?

    To Solve Npm install cannot find module 'semver' Error If this occurs right after you run brew install yarn try running yarn global add npm and voilà – fixed!

  2. Npm install cannot find module 'semver'

    To Solve Npm install cannot find module 'semver' Error If this occurs right after you run brew install yarn try running yarn global add npm and voilà – fixed!

Solution 1

I had the same error. npm uninstall npm -grm -rf node_modules didn’t help me, because when I tried I was getting Error: Cannot find module 'semver'. But I solve my problem with these steps (this will delete other global modules you may be using):

  • sudo rm -rf /usr/local/lib/node_modules
  • sudo rm -rf ~/.npm
  • brew uninstall --force node
  • brew install node

Hope this will help those who are getting a similar problem.

Solution 2

I’m facing the same issue here.

If this occurs right after you run brew install yarn try running yarn global add npm and voilà – fixed!

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also Read

Leave a Comment