Mac电脑npm:Failed to download repo vuejs-templates/webpack: tunneling socket could not be established,

简介: Mac电脑npm:Failed to download repo vuejs-templates/webpack: tunneling socket could not be established,

博主最近在使用vue时,通过:

vue init webpack vuecliTest

时一直报错:

Failed to download repo vuejs-templates/webpack: tunneling socket could not be established, cause=connect ETIMEDOUT


多方寻求答案无果,最后找到一种方法来解决:

npm config rm proxy
npm config rm https-proxy

输入以上命令行继续执行即可。


但是这里要注意一个问题,Mac环境下使用npm时最好加上sudo,并且npm加上c为cnpm来使用。


最后的结果为

sudo vue init webpack vuecliTest

完整的执行代码放下面:

sudo cnpm install --global vue-cli
sudo vue init webpack my-project
cd my-project
npm install
npm run dev
目录
相关文章
|
2月前
|
安全 网络安全 开发工具
Mac电脑多平台Git账号设置
通过配置SSH密钥与config文件,可为GitHub、Gitee等平台分配独立密钥,实现自动识别与认证。生成密钥后,将公钥添加至对应平台,并在~/.ssh/config中设置主机别名与密钥路径。此后使用SSH地址克隆仓库,Git将自动选用正确密钥,免去手动切换与密码输入,提升效率与安全性。(238字)
260 2
|
7月前
|
人工智能 安全 虚拟化
Cua:Mac用户狂喜!这个开源框架让AI直接接管你的电脑,快速实现AI自动化办公
Cua是一个结合高性能虚拟化与AI代理能力的开源框架,能在Apple Silicon上以接近原生性能运行虚拟机,并让AI直接操作系统应用。
907 17
Cua:Mac用户狂喜!这个开源框架让AI直接接管你的电脑,快速实现AI自动化办公
|
8月前
|
存储 数据安全/隐私保护 开发者
苹果app上架app store 之苹果开发者账户在mac电脑上如何使用钥匙串访问-发行-APP发布证书ios_distribution.cer-优雅草卓伊凡
苹果app上架app store 之苹果开发者账户在mac电脑上如何使用钥匙串访问-发行-APP发布证书ios_distribution.cer-优雅草卓伊凡
321 8
苹果app上架app store 之苹果开发者账户在mac电脑上如何使用钥匙串访问-发行-APP发布证书ios_distribution.cer-优雅草卓伊凡
|
8月前
|
移动开发 JavaScript 前端开发
vue中npm打包遇到× eslint —fix found some errors. Please fix them and try committing again.husky > pre-commit hook failed (add —no-verify to bypass)报错解决方案-卓伊凡
vue中npm打包遇到× eslint —fix found some errors. Please fix them and try committing again.husky > pre-commit hook failed (add —no-verify to bypass)报错解决方案-卓伊凡
286 7
vue中npm打包遇到× eslint —fix found some errors. Please fix them and try committing again.husky > pre-commit hook failed (add —no-verify to bypass)报错解决方案-卓伊凡
|
7月前
|
SQL 测试技术 API
mac电脑也是用postman吗
postman是外国的软件,速度和用户体验没有国内的api测试软件好。国内可以使用yunedit-post代替postman来做接口测试。
142 7
|
11月前
|
人工智能 机器人 Android开发
ChatGPT拓展PC/Mac应用集成,迈向电脑操控新时代
ChatGPT拓展PC/Mac应用集成,迈向电脑操控新时代
|
Oracle Java 关系型数据库
Mac电脑上安装和配置Flutter开发环境
Mac电脑上安装和配置Flutter开发环境
497 60
verbose stack FetchError: request to https://registry.npm.taobao.org/md-editor-v3 failed, reason: ce
这篇文章描述了在安装npm包`md-editor-v3`时遇到的淘宝镜像证书过期问题,并提供了解决方案,即通过切换npm镜像源到`https://registry.npmmirror.com/`来解决安装失败的问题。
verbose stack FetchError: request to https://registry.npm.taobao.org/md-editor-v3 failed, reason: ce
|
网络安全 数据安全/隐私保护 Python
6-10|pycharm如何远程连接mac电脑
6-10|pycharm如何远程连接mac电脑
|
缓存 JavaScript 前端开发
8种方法解决vue创建项目报错:command failed: npm install --loglevel error
该文章提供了八种解决Vue项目创建时遇到的`command failed: npm install --loglevel error`错误的方法,包括清理缓存、更换npm源、重新安装Node.js等措施。
8种方法解决vue创建项目报错:command failed: npm install --loglevel error

推荐镜像

更多
  • NPM