vue : 无法将“vue”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确, 然后再试一次。

报错内容

vue : 无法将“vue”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,
然后再试一次。
所在位置 行:1 字符: 1
+ vue -v
+ ~~~
    + CategoryInfo          : ObjectNotFound: (vue:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

解决方案

  • 方案一:
npm install vue-cli -g  //我的报错解决
  • 方案二:
npm install -g @vue/cli	//我的报错执行后,还是未解决
上面两种 CLI 的安装都是不同版本,也许是对应的 VUE 版本有关吧。
各位大神,请留言指教。谢谢!
  • 对于方案二的未解决,是因为 npm 安装 CLI 失败导致的,以下是报错代码
npm ERR! code EEXIST
npm ERR! path x:\Program Files\nodejs\node_modules\@vue\cli\node_modules\_apollo-server-express@2.25.2@apollo-server-express\node_modules\@apollographql\graphql-playground-html\node_modules\.bin\xss.ps1
npm ERR! Refusing to delete x:\Program Files\nodejs\node_modules\@vue\cli\node_modules\_apollo-server-express@2.25.2@apollo-server-express\node_modules\@apollographql\graphql-playground-html\node_modules\.bin\xss.ps1: ../../../../_xss@1.0.9@xss/bin/xss symlink target is not controlled by npm x:\Program Files\nodejs\node_modules\@vue\cli\node_modules\_apollo-server-express@2.25.2@apollo-server-express\node_modules\@apollographql\graphql-playground-html\node_modules\xss
npm ERR! File exists: x:\Program Files\nodejs\node_modules\@vue\cli\node_modules\_apollo-server-express@2.25.2@apollo-server-express\node_modules\@apollographql\graphql-playground-html\node_modules\.bin\xss.ps1
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.

npm ERR! A complete log of this run can be found in:
npm ERR!     X:\Users\lq\AppData\Roaming\npm-cache\_logs\2021-08-31T06_22_53_363Z-debug.log
  • 通过 cnpm 后,还是无法识别 vue , 报错如下:
vue : 无法将“vue”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,
然后再试一次。
所在位置 行:1 字符: 1
+ vue
+ ~~~
    + CategoryInfo          : ObjectNotFound: (vue:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

  • 5
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值