@vue/cli 3.x 创建项目失败解决方案

报错信息

command failed: yarn --registry=https://registry.npm.taobao.org --disturl=https://npm.taobao.org/dist

报错原因

经bug修复后查明是yarn问题,yarn不能使用https://registry.npm.taobao.org源,所以报出了该错误,yarn在安装完毕后会修改默认包使用方式为yarn,而vue提供的源yarn又不支持使用,所以报错

复现bug

C:\Users\Administrator\.vuerc文件中packageManager修改为yarn即可复现该bug

修复方法

该bug可能有一些并发原因,修复方法如下,请参考使用

前置条件

确保vue-cli,npm,node都是新版本,node在8+以上版本

方法一:清除npm缓存

npm cache clean --force

方法二:设置chromedriver

npm install chromedriver --chromedriver_cdnurl=http://cdn.npm.taobao.org/dist/chromedriver

方法三:修改npm,yarn源

npm install -g cnpm --registry=https://registry.npm.taobao.org

方法四:修改默认包管理器

找到C:\Users\Administrator\.vuerc这个文件

设置packageManagernpm

vue-create 报错 command failed: yarn --registry=https://registry.npm.taobao.org --disturl=https://npm.taobao.org/dist 完美解决方案的更多相关文章

  1. appium在android 7.0真机上运行报错command failed shell:............ps:'uiautomator"的解决方式

    appium版本:1_4_16 在CSDN中找到相关解决的方案,根据此解决方案顺利的解决了让人惆怅的问题,再次记录. 1.找到appium安装目录下的adb.js文件,目录为:Appium\node_ ...

  2. Vue.js报错Failed to resolve filter问题原因

    Vue.js报错Failed to resolve filter问题原因 金刚 vue Vue.js js javascript 之前使用vue.js写分页功能时,写了一个过滤器,发现一个比较奇怪的错 ...

  3. 解决Eclipse启动报错【Failed to create the Java Virtual Machine】

    电脑:2G内存,WIN7 32位. 启动adt-bundle-windows-x86-20140702\eclipse\eclipse.exe时,报错[Failed to create the Jav ...

  4. ionic 打包 报错Execution failed for task ':processDebugResources'. > com.android.ide.common.process.ProcessException: Failed to execute aapt

    在platform --> android目录下找到build.gradle文件,打开并在def promptForReleaseKeyPassword() {...}函数前加入以下内容: 完整 ...

  5. docker—tomcat 报错:Failed to get D-Bus connection: Operation not permitted

    docker search centos   查系统镜像 docker pull docker.io/centos 进入容器 [root@git opt]# docker images REPOSIT ...

  6. svn报错cleanup failed–previous operation has not finished; run cleanup if it was interrupted的解决办法

    今天在svn提交的时候它卡顿了一下,我以为已经提交完了,就按了一下,结果就再也恢复不了,也继续不了了... 报错 cleanup failed–previous operation has not f ...

  7. Vue的报错:Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>'

    Vue的报错:Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>' ...

  8. docker报错:Failed to restart docker.service: Unit not found.

    前言:我之前安装好docker了,但是关机重启后,发现docker就没了 报错:Failed to restart docker.service: Unit not found.   解决方法: 1. ...

  9. 报错:Failed on local exception: Host Details : local host is: "master/192.168.52.26"; dest

    报错现象 Failed on local exception: com.google.protobuf.InvalidProtocolBufferException: Protocol message ...

随机推荐

  1. 深入理解 web 协议(一)- http 包体传输

    本文首发于 vivo互联网技术 微信公众号 链接:https://mp.weixin.qq.com/s/WlT8070LlrnSODFRDwZsUQ作者:吴越 开坑这个系列的原因,主要是在大前端学习的 ...

  2. AOP框架Dora.Interception 3.0 [2]: 实现原理

    和所有的AOP框架一样,我们必须将正常的方法调用进行拦截,才能将应用到当前方法上的所有拦截器纳入当前调用链.Dora.Interception采用IL Eimit的方式实现对方法调用的拦截,接下来我们 ...

  3. cmd 环境下载文件的几种方法

    今天渗透测试面试提到cmd下载文件  ,自己只写了js和certutil,还有几种常见的方法自己没想起来 这里记录和总结下 . (自己还是太菜太垃圾.) 0x01 certutil certutil ...

  4. Yroot of High-Precisions (luogu P2293 [HNOI2004]高精度开根)

    Background\text{Background}Background I've accepted\text{I've accepted}I've accepteda very good prob ...

  5. [Luogu3070][USACO13JAN]岛游记Island Travels

    题目描述 Farmer John has taken the cows to a vacation out on the ocean! The cows are living on N (1 < ...

  6. java源码解析

    String深入解析 String具有不变性的原因: String被final修饰,它不可能被继承,也就是任何对String的操作方法,都不会被继承覆写 String中保存数据的是一个char数组的v ...

  7. vue MD5 加密

    确保vue项目中有MD5的依赖,当然没有的可以安装crypto模块. npm安装: npm install --save crypto 在main.js文件中将md5引入,可以全局使用的 import ...

  8. pycharm中拉取新分支代码

    将本地代码由主分支切换到新分支 切换成功

  9. ios 11 系统CPU过高,xib中textfield使用导致出过高

    ios11 发布之后,作为开发肯定是第一时间进行了升级测试,全新的系统不免会带来这样那样的问题.项目中使用xib的小伙伴们会发现,项目的cpu使用率非常高,尤其是初始化的时候,并没有线程的操作,CPU ...

  10. SpringBoot整合MybatisPlus3.X之自定义Mapper(十)

    pom.xml <dependencies> <dependency> <groupId>org.springframework.boot</groupId& ...