Error: Cannot find module 'semver'
at Function.Module._resolveFilename (module.js:555:15)
at Function.Module._load (module.js:482:25)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/unsupported.js:2:14)
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
Cannot find module ‘XXXXX’ has encountered this problem,
I have tried:
npm install semver
npm install -g socket.io
This is not going to work.
and then find another solution.
first see if your NPM is useful. Check method: open the terminal and enter
npm -v
If the error is reported, then it is necessary to re-install NPM. First, the original NPM is deleted. The method is:
, you can go to the global NPM package to have a look, the path is:
/usr/local/lib/node_modules/npm
Go to the Semver folder in NOde_modules in NPM and you’ll see that it’s empty! Or no, we will know why semver module can not be found!
1. First delete the global NPM package: just mentioned /usr/local/lib/node_modules/ NPM, this NPM folder delete
2. Go to /usr/local/lib/node_modules and clone git from GitHub
git clone --recursive git://github.com/isaacs/npm.git
This brings the new NPM package back to global node_modules
.
npm -v
Check it in the terminal. If you can print it out, that’s fine.
Read More:
- What to do when idea Maven package appears could not find artifact xxxxx!
- Module build failed: error: cannot find module ‘node sass’ error
- Error reported after moving or copying Vue items: cannot find module ‘xxx‘
- Error: Cannot find module ‘process-nextick-args’
- [Solved] Error: Cannot find module ‘webpack/lib/RequestShortener’
- Error: Cannot find module’webpack/bin/config-yargs’ solution
- Error: Cannot find module ‘webpack/schemas/WebpackOptions.json’
- npm run devstart error: Error: Unable to find module ‘semver’
- Gulp Error: Cannot find module ‘jshint/src/cli’;
- Error: cannot find module ‘mongoose’
- Solved – problem cannot find module ‘webpack / bin / config yargs’
- Copy node causes NPM execution error: cannot find module ‘/ / lib / utils/ unsupported.js ‘
- Cannot find module ‘internal / util / types’ appears during gulp build
- nodejs Error: Cannot find module ‘ejs‘
- Cannot find module ‘lodash’
- node.js Cannot find module “XXX” solution
- [Solved] Error: Cannot find module ‘@vue/cli-shared-utils
- Node.js Cannot find module ‘mysql’ ‘express’
- Error: cannot find module ‘webpack / lib / ruleset’_ solve
- Cannot find module ‘body-parser’