
node.js
记录node.js学习过程中的心得和问题
老鼠只爱大米
只会写诗的程序员
展开
-
npm如何设置代理和镜像
由于网络原因,使用npm下载nodejs依赖包时,经常会出现下载失败的情况,这里就需要设置镜像和代理。现将具体操作总结如下:一、设置镜像1.npm设置镜像npm config set registry=镜像地址//设置阿里镜像npm config set registry=https://registry.npm.taobao.org2.npm取消镜像npm config delete registry3.npm查看镜像信息npm config get原创 2020-12-22 15:24:19 · 7770 阅读 · 0 评论 -
npm安装下载依赖包失败的问题
使用npm下载nodejs依赖包时,会出现下载失败,可以使用如下方法解决:1. npm默认的镜像地址为国外镜像地址npm config get registry# http://registry.npmjs.org 为国外镜像地址从国外镜像地址下载依赖包时,速度很慢甚至会出现异常。因此可以将npm的镜像地址改为国内镜像,阿里镜像:https://registry.npm.taobao.orgnpm config set registry https://registry.npm.tao原创 2020-12-22 15:16:36 · 4396 阅读 · 0 评论