最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已解决】npm WARN [email protected] requires a peer of vue@^2.5.2 but none was installed

npm crifan 12913浏览 0评论

折腾:

【部分解决】把vue-element-admin的ElementUI的版本从1.4升级到最新的2.0

期间,在:

npm install element-ui –save

时看到有警告:

npm WARN [email protected] requires a peer of vue@^2.5.2 but none was installed.

意思好像是?

[email protected]要求Vue是2.5.2或更高版本才行。

而在:

【已解决】vue-element-admin升级到Element-UI到2.0.1后报错:Vue warn Injection elForm not found

中,猜测,升级到最新的2.5.2,或许错误就解决了。

所以此处再去试试:

升级Vue到最新版本2.5.2

➜  HeadquarterReport git:(permission-control) ✗ npm uninstall vue –S
[email protected] node_modules/vue
npm WARN [email protected] requires a peer of vue@^2.5.2 but none was installed.
npm WARN [email protected] No repository field.
   ╭─────────────────────────────────────╮
   │                                     │
   │   Update available 4.6.1 → 5.5.1    │
   │     Run npm i -g npm to update      │
   │                                     │
   ╰─────────────────────────────────────╯
➜  HeadquarterReport git:(permission-control) ✗ npm install vue -S
[email protected] /Users/crifan/dev/dev_root/xxx
npm WARN [email protected] No repository field.

然后再去重新编译试试

结果出错:

【已解决】Vue packages version mismatch [email protected] [email protected]

只不过又出现其他警告:

【已解决】Vue警告:the scope attribute for scoped slots have been deprecated and replaced by slot-scope since 2.5

然后貌似就没了这个警告了。

在卸载重装其他库,比如vue-template-compiler,时都没了这个警告了。

【总结】

此处升级vue到最新2.5.2版本的过程是:

1.先卸载再安装:

npm uninstall vue —S

npm install vue -S

2.如果出现我此处的vue-template-compiler版本不匹配的话,则再去

卸载重装vue-template-compiler:

npm uninstall vue-template-compiler -D

npm install vue-template-compiler -D

3.代码中如果之前有(template中的)scope,则改为slot-scope

转载请注明:在路上 » 【已解决】npm WARN [email protected] requires a peer of vue@^2.5.2 but none was installed

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
84 queries in 0.164 seconds, using 22.03MB memory