Error: Cannot find module 'semver'
程序员文章站
2022-06-01 08:50:09
...
vue工程build时失败,报错如下
internal/modules/cjs/loader.js:583
throw err;
^
Error: Cannot find module 'semver'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (C:\Users\pikachu\Documents\manager-web\node_modules\[email protected][email protected]@@vue\cli-service\bin\vue-cli-service.js:3:16)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `vue-cli-service build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build 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\pikachu\AppData\Roaming\npm-cache\_logs\2019-03-05T08_53_13_258Z-debug.log
Process finished with exit code 1
把这个包安装完,后面还出现js-xxx的各种包,实在是烦
最后我把vue的版本改为最新版本2.6.8
,把iview的版本改为最新版本3.3.0
,删掉.lock文件,重新cnpm i
好了
build 成功
上一篇: Cannot find module 'express'
下一篇: spring mvc 下,ajax调用后台controller方法时报415 (Unsupported Media Type)错误
推荐阅读
-
编译PHP报错configure error Cannot find libmysqlclient under usr的解决方法
-
编译PHP报错configure error Cannot find libmysqlclient under usr的解决方法
-
webpack-dev-server config.js Cannot find module
-
cannot find supercluster & native module cannot be null & Xcode build timeout
-
Error: ENOENT: no such file or directory, uv_cwd Error: Cannot find module
-
【已解决】运行webpack-dev-server时提示Error: Cannot find module ‘webpack-cli/bin/config-yargs‘
-
An unhandled exception occurred: Cannot find module '@angular-devkit/build-angular/package.json'
-
webpack5: Error: Cannot find module ‘webpack-cli/bin/config-yargs‘
-
Webpack 报错:Error: Cannot find module ‘webpack-cli/bin/config-yargs‘
-
webpack-dev-server 报错 Error: Cannot find module ‘webpack/bin/config-yargs‘