Fixing “error: cannot find module semver” error in Node.js

Fixing “error: cannot find module semver” error in Node.js

Autopublished from RSS Original article

npm

When installing a package using npm, you might encounter the “error: cannot find module semver” error. Bash The error is caused because of a corrupted package-lock.json or yarn.lock. The most common reason for this is a change in the node version. The fix is a pretty simple one. We need to nuke the node_modules folder and the lock file. Bash Then we need to clear our npm cache: Bash And re-install...

Source