npm run dev:Error: Cannot find module 'semver'

created at 08-06-2021 views: 156

error message

PS C:\Users\wangting\Desktop\Wisdom_admin\wisdom_admin> npm run dev

> eladmin-web@2.6.0 dev C:\Users\wangting\Desktop\Wisdom_admin\wisdom_admin
> vue-cli-service serve

internal/modules/cjs/loader.js:985
  throw err;
  ^

Error: Cannot find module 'semver'
Require stack:
- C:\Users\wangting\Desktop\Wisdom_admin\wisdom_admin\node_modules\_@vue_cli-service@3.5.3@@vue\cli-service\bin\vue-cli-service.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
    at Function.Module._load (internal/modules/cjs/loader.js:864:27)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (C:\Users\wangting\Desktop\Wisdom_admin\wisdom_admin\node_modules\_@vue_cli-service@3.5.3@@vue\cli-service\bin\vue-cli-service.js:3:16)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\wangting\\Desktop\\Wisdom_admin\\wisdom_admin\\node_modules\\_@vue_cli-service@3.5.3@@vue\\cli-service\\bin\\vue-cli-service.js'
  ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1        
npm ERR! eladmin-web@2.6.0 dev: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the eladmin-web@2.6.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\wangting\AppData\Roaming\npm-cache\_logs\2021-08-06T06_20_38_961Z-debug.log
PS C:\Users\wangting\Desktop\Wisdom_admin\wisdom_admin> 

solution

1. Delete node_modules

2. Then open the vscode editor, open the terminal, enter the project directory, install dependencies

cnpm install

After the dependency installation is complete.

Just start it again

3. restart:

npm run dev
created at:08-06-2021
edited at: 08-06-2021: