NPM-安装报错connect ETIMEDOUT

NPM-安装报错connect ETIMEDOUT

    • 解决方案
    • [常用NPM YARN操作](#常用NPM YARN操作)

解决方案

  1. 报错信息request to https://registry.npm.taobao.org/yarn failed, reason: connect ETIMEDOUT
java 复制代码
1、npm set strict-ssl false
2、设置代理
npm config set proxy http://xxx:xxx@openproxy.ali.com:8080
  1. yarn install报错'vue-cli-service' 不是内部或外部命令,也不是可运行的程序
java 复制代码
 yarn config set strict-ssl false
 yarn install

常用NPM YARN操作

  1. npm如何在安装的时候指定源

npm install -g yarn@1.22.19 --registry=https://registry.npm.taobao.org

  1. 如何查看设置registry和proxy、配置

npm config get

查看和设置镜像

npm get registry

npm config set registry https://registry.npmjs.org/

npm config set ELECTRON_MIRROR "https://npm.taobao.org/mirrors/electron/"

npm config get ELECTRON_MIRROR

npm config delete ELECTRON_MIRROR

设置代理

npm config set proxy http://server:port

npm config set https-proxy http://server:port

查看代理

npm config get proxy

npm config get https-proxy

删除代理

npm config set proxy null

npm config set https-proxy null

yarn设置代理

yarn config set proxy http://xxx:xxx@openproxy.ali.com:8080

yarn删除代理

yarn config delete proxy

相关推荐
ai小鬼头39 分钟前
百度秒搭发布:无代码编程如何让普通人轻松打造AI应用?
前端·后端·github
漂流瓶jz39 分钟前
清除浮动/避开margin折叠:前端CSS中BFC的特点与限制
前端·css·面试
前端 贾公子41 分钟前
在移动端使用 Tailwind CSS (uniapp)
前端·uni-app
散步去海边42 分钟前
Cursor 进阶使用教程
前端·ai编程·cursor
清幽竹客43 分钟前
vue-30(理解 Nuxt.js 目录结构)
前端·javascript·vue.js
weiweiweb88844 分钟前
cesium加载Draco几何压缩数据
前端·javascript·vue.js
幼儿园技术家1 小时前
微信小店与微信小程序简单集成指南
前端
我不吃饼干9 天前
鸽了六年的某大厂面试题:你会手写一个模板引擎吗?
前端·javascript·面试
涵信9 天前
第一节 布局与盒模型-Flex与Grid布局对比
前端·css
我不吃饼干9 天前
鸽了六年的某大厂面试题:手写 Vue 模板编译(解析篇)
前端·javascript·面试