Vue:安装@ vue / cli后找不到命令

问题描述 投票:1回答:2

我不知道为什么不为我工作。我以管理员身份打开PowerShell并运行npm install -g @vue/cli。我已经完成卸载vue-cli并再次重新安装不起作用。这是我的错误

PS C:\WINDOWS\system32> npm install -g @vue/cli
npm WARN deprecated [email protected]: cross-spawn no longer requires a build toolchain, use it instead
C:\Users\Lin Aung\AppData\Roaming\npm\vue -> C:\Users\Lin Aung\AppData\Roaming\npm\node_modules\@vue\cli\bin\vue.js

> [email protected] postinstall C:\Users\Lin Aung\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\protobufjs
> node scripts/postinstall


> [email protected] postinstall C:\Users\Lin Aung\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\nodemon
> node bin/postinstall || exit 0

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\@vue\cli\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ @vue/[email protected]
added 680 packages from 509 contributors in 172.749s
PS C:\WINDOWS\system32> vue
vue : The term 'vue' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ vue
+ ~~~
+ CategoryInfo          : ObjectNotFound: (vue:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

PS C:\WINDOWS\system32>
vue.js vue-cli
2个回答
2
投票

%APPDATA%\npm添加到PATH修复了我的问题


1
投票

使用sudo安装

sudo yarn global add @ vue / cli

© www.soinside.com 2019 - 2024. All rights reserved.