Error: command failed: yarn

异常信息

在这里插入图片描述

info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
 ERROR  Error: command failed: yarn 
Error: command failed: yarn 
    at ChildProcess.<anonymous>

解决

解决方法一:

Win+R 输入cmd进入到命令行界面
输入命令 重新安装yarn

npm install -g yarn

成功后重新创建vue-cli项目便可以解决了。


解决方法二:

进入到Windows环境中C:/users/administrator/下
在这里插入图片描述
打开此文件,显示

{
    
    
  "useTaobaoRegistry": false,
  "packageManager": "yarn"
}

只需手动更改配置内容yarn为 npm,即可更改创建项目时的包管理器了


解决方法三:终极办法

删除.vuerc文件,在初次创建vue项目会提示选择配置,到时候选择npm就可以。

猜你喜欢

转载自blog.csdn.net/qq_40374604/article/details/129415260
今日推荐