npm ERR! code ELIFECYCLEnpm ERR! errno 1npm ERR! vue-element@4.4.0 dev: `vue-cli-service serve`np解决方

开发者在尝试使用npmrundev命令时遇到Vue版本冲突错误,文章指导用户更新或重新安装vue-template-compiler以确保版本一致,从而解决问题。
摘要由CSDN通过智能技术生成
PS D:\code\LvLiangSmartConstruct\stage_01\code\client\DevFrontend\backstage-manage-gd-pm> npm run dev

> vue-element@4.4.0 dev D:\code\LvLiangSmartConstruct\stage_01\code\client\DevFrontend\backstage-manage-gd-pm
> vue-cli-service serve

 INFO  Starting development server...
 ERROR  Error: 

Vue packages version mismatch:

- vue@2.6.10 (D:\code\LvLiangSmartConstruct\stage_01\code\client\DevFrontend\backstage-manage-gd-pm\node_modules\vue\dist\vue.runtime.common.js)
- vue-template-compiler@2.7.16 (D:\code\LvLiangSmartConstruct\stage_01\code\client\DevFrontend\backstage-manage-gd-pm\node_modules\vue-template-compiler\package.json)

This may cause things to work incorrectly. Make sure to use the same version for both.
If you are using vue-loader@>=10.0, simply update vue-template-compiler.
If you are using vue-loader@<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest.

Error: 

Vue packages version mismatch:

- vue@2.6.10 (D:\code\LvLiangSmartConstruct\stage_01\code\client\DevFrontend\backstage-manage-gd-pm\node_modules\vue\dist\vue.runtime.common.js)
- vue-template-compiler@2.7.16 (D:\code\LvLiangSmartConstruct\stage_01\code\client\DevFrontend\backstage-manage-gd-pm\node_modules\vue-template-compiler\package.json)

This may cause things to work incorrectly. Make sure to use the same version for both.
If you are using vue-loader@>=10.0, simply update vue-template-compiler.
If you are using vue-loader@<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest.

    at Object.<anonymous> (D:\code\LvLiangSmartConstruct\stage_01\code\client\DevFrontend\backstage-manage-gd-pm\node_modules\vue-template-compiler\index.js:10:9)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at loadFromContext (D:\code\LvLiangSmartConstruct\stage_01\code\client\DevFrontend\backstage-manage-gd-pm\node_modules\@vue\cli-service\node_modules\vue-loader\lib\compiler.js:30:10)
    at loadTemplateCompiler (D:\code\LvLiangSmartConstruct\stage_01\code\client\DevFrontend\backstage-manage-gd-pm\node_modules\@vue\cli-service\node_modules\vue-loader\lib\compiler.js:37:12)
    at exports.resolveCompiler (D:\code\LvLiangSmartConstruct\stage_01\code\client\DevFrontend\backstage-manage-gd-pm\node_modules\@vue\cli-service\node_modules\vue-loader\lib\compiler.js:25:23)
    at VueLoaderPlugin.apply (D:\code\LvLiangSmartConstruct\stage_01\code\client\DevFrontend\backstage-manage-gd-pm\node_modules\@vue\cli-service\node_modules\vue-loader\lib\plugin-webpack4.js:91:22)
    at VueLoaderPlugin.apply (D:\code\LvLiangSmartConstruct\stage_01\code\client\DevFrontend\backstage-manage-gd-pm\node_modules\@vue\cli-service\node_modules\vue-loader\lib\plugin.js:13:16)
    at webpack (D:\code\LvLiangSmartConstruct\stage_01\code\client\DevFrontend\backstage-manage-gd-pm\node_modules\webpack\lib\webpack.js:51:13)
    at serve (D:\code\LvLiangSmartConstruct\stage_01\code\client\DevFrontend\backstage-manage-gd-pm\node_modules\@vue\cli-service\lib\commands\serve.js:163:22)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vue-element@4.4.0 dev: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vue-element@4.4.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\Administrator\AppData\Roaming\npm-cache\_logs\2024-02-23T05_16_34_986Z-debug.log

卸载vue-template-compiler,重新安装vue-template-compiler@2.7.16。install一下。就好了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值