vue和vue-server-renderer的版本不一致,导致编译打包异常(This may cause things to work incorrectly)

问题描述:

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",
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值