We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3.3.0
node: v11.6.0 yarn: 1.13.0 npm: 6.6.0 windows10: 17763.253
使用yarn的独立安装包安装yarn
yarn global add @vue/cli vue -V
powershell输出如下:
vue : 无法加载文件 %AppData%\Local\Yarn\bin\vue.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。 所在位置 行:1 字符: 1 vue -V CategoryInfo : SecurityError: (:) [],PSSecurityException FullyQualifiedErrorId : UnauthorizedAccess
在网上搜索使用如下方法:
以管理员身份打开PowerShell 输入Set-ExecutionPolicy RemoteSigned,执行策略更改
再次执行:
vue -V
powershell 输出如下:
所在位置 C:\Users\MengQing\AppData\Local\Yarn\bin\vue.ps1:5 字符: 13 CYGWIN) basedir=cygpath -w "$basedir";; ~ 表达式或语句中包含意外的标记“)”。 所在位置 %AppData%\Local\Yarn\bin\vue.ps1:8 字符: 3 if [ -x "$basedir/pwsh" ]; then ~ if 语句中的“if”后面缺少“(”。 所在位置 C:\Users\MengQing\AppData\Local\Yarn\bin\vue.ps1:8 字符: 5 if [ -x "$basedir/pwsh" ]; then ~ "[" 后面缺少类型名称。 所在位置 C:\Users\MengQing\AppData\Local\Yarn\bin\vue.ps1:9 字符: 20 ... sedir/pwsh" "$basedir/../Data/global/node_modules/.bin/vue.ps1" "$@" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 表达式或语句中包含意外的标记“"$basedir/../Data/global/node_modules/.bin/vue.ps1"”。 所在位置 C:\Users\MengQing\AppData\Local\Yarn\bin\vue.ps1:9 字符: 72 ... sedir/pwsh" "$basedir/../Data/global/node_modules/.bin/vue.ps1" "$@" ~~~~ 表达式或语句中包含意外的标记“"$@"”。 CategoryInfo : ParserError: (:) [], ParseException FullyQualifiedErrorId : UnexpectedToken
cygpath -w "$basedir"
cmd能够正常输出。
powershell下正常执行命令
抛出错误
如果通过npm安装yarn
则会得到:
vue不是内部或外部命令,也不是可运行的程序或批处理文件。
The text was updated successfully, but these errors were encountered:
Possible related: yarnpkg/yarn#6902
Sorry, something went wrong.
😂原来是yarn挖的坑,另外问下 vue upgrade 是不是只能通过 yarn 安装 @vue/cli @vue/cli-upgrade 才能运行,npm安装的不行。
vue upgrade
@vue/cli @vue/cli-upgrade
原 issue 已在 Yarn 1.15.2 中修复。
vue upgrade 的问题近期会修掉。
Thank you. That solved my problem
我也遇到了这个问题,当我使用 PowerShell 的时候会出这个错,当我使用 Git Bash 的时候是正常的
No branches or pull requests
Version
3.3.0
Environment info
Steps to reproduce
使用yarn的独立安装包安装yarn
powershell输出如下:
在网上搜索使用如下方法:
再次执行:
vue -V
powershell 输出如下:
cmd能够正常输出。
What is expected?
powershell下正常执行命令
What is actually happening?
抛出错误
如果通过npm安装yarn
则会得到:
The text was updated successfully, but these errors were encountered: