vue -V 执行失败 檔案名稱、目錄名稱或磁碟區標籤語法錯誤。

vue -V 执行失败

提示 :檔案名稱、目錄名稱或磁碟區標籤語法錯誤。

安装 @Vue/cli 流程

yarn global add @vue/cli

yarn global v1.22.10
[1/4] Resolving packages...
warning @vue/cli > @vue/cli-shared-utils > @hapi/joi@15.1.1: Switch to 'npm install joi'
warning @vue/cli > @vue/cli-shared-utils > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
warning @vue/cli > @vue/cli-shared-utils > @hapi/joi > @hapi/address@2.1.4: This version has been deprecated and is no longer supported or maintained
warning @vue/cli > @vue/cli-shared-utils > @hapi/joi > @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
warning @vue/cli > @vue/cli-shared-utils > @hapi/joi > @hapi/topo > @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
warning @vue/cli > @vue/cli-shared-utils > request > har-validator@5.1.5: this library is no longer supported
warning @vue/cli > globby > fast-glob > micromatch > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
warning @vue/cli > globby > fast-glob > micromatch > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
[2/4] Fetching packages...
info fsevents@2.3.2: The platform "win32" is incompatible with this module.
info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "umi > @umijs/bundler-webpack > postcss-loader@4.2.0" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
[4/4] Building fresh packages...
success Installed "@vue/cli@4.5.12" with binaries:
      - vue

vue --v

檔案名稱、目錄名稱或磁碟區標籤語法錯誤。

经过老夫反复研究
解决思路如下:

yarn global bin ==> 得到路径 D:\apps\node\node_global\bin
发现 node_global\bin\vue.cmd 内容为
@"%~dp0\C:\Users\Administrator\AppData\Local\Yarn\Data\global\node_modules.bin\vue.cmd" %*

改为 @C:\Users\Administrator\AppData\Local\Yarn\Data\global\node_modules.bin\vue.cmd" %*

vue -V ==> @vue/cli 4.5.12 成功

主要原因 vue.cmd 语法 %~dp0 执行识别有问题

类似的 都可以这样解决

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值