问题描述:
09:24:52 Vue packages version mismatch:
09:24:52
09:24:52 - vue@2.7.11
09:24:52 - vue-server-renderer@2.7.10
09:24:52
09:24:52 This may cause things to work incorrectly. Make sure to use the same version for both.
09:24:52
09:24:52 at Object.<anonymous> (/var/jenkins_home/pl114567/node_modules/vue-server-renderer/index.js:8:9)
09:24:52 at Module._compile (module.js:652:30)
09:24:52 at Object.Module._extensions..js (module.js:663:10)
09:24:52 at Module.load (module.js:565:32)
09:24:52 at tryModuleLoad (module.js:505:12)
09:24:52 at Function.Module._load (module.js:497:3)
09:24:52 at Module.require (module.js:596:17)
09:24:52 at require (internal/module.js:11:18)
09:24:52 at Object.<anonymous> (/var/jenkins_home/pl114567/node_modules/nuxt/lib/core/renderer.js:8:34)
09:24:52 at Module._compile (module.js:652:30)
09:24:52 npm info lifecycle ssr@1.0.0~build:dev: Failed to exec build:dev script
09:24:52 npm ERR! code ELIFECYCLE
09:24:52 npm ERR! errno 1
09:24:52 npm ERR! ssr@1.0.0 build:dev: `cross-env __ENV=development nuxt build`
09:24:52 npm ERR! Exit status 1
09:24:52 npm ERR!
09:24:52 npm ERR! Failed at the ssr@1.0.0 build:dev script.
09:24:52 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
09:24:52
09:24:52 npm ERR! A complete log of this run can be found in:
09:24:52 npm ERR! /var/jenkins_home/.npm/_logs/2022-10-15T01_24_52_877Z-debug.log
09:24:52 cp: cannot stat ‘.nuxt’: No such file or directory
解决办法:打包的时候不要提交package-lock.json,同时指定版本号,不要使用 ^
来指定版本号,使用下面这种方式:
"vue": "2.6.10",
"vue-server-renderer": "2.6.10",