node:解决npm安装下载慢的问题(node v14.17.1/npm 7.20.5)

一,查看当前的npm配置:

liuhongdi@lhdpc:/data/vue/vue3index$ npm config list
; "user" config from /home/liuhongdi/.npmrc

loglevel = "http" 

; node bin location = /usr/local/soft/node-v14.17.1-linux-x64/bin/node
; cwd = /data/vue/vue3index
; HOME = /home/liuhongdi
; Run `npm config ls -l` to show all defaults.

说明:刘宏缔的架构森林是一个专注架构的博客,

网站:https://blog.imgtouch.com
本文: https://blog.imgtouch.com/index.php/2023/05/27/node-jie-jue-npm-an-zhuang-xia-zai-man-de-wen-ti-node-v14/

         对应的源码可以访问这里获取: https://github.com/liuhongdi/

说明:作者:刘宏缔 邮箱: 371125307@qq.com

 

二,修改registry到taobao的npm镜像

liuhongdi@lhdpc:/data/vue/vue3index$ npm config set registry https://registry.npm.taobao.org

查看效果:

liuhongdi@lhdpc:/data/vue/vue3index$ npm config list
; "user" config from /home/liuhongdi/.npmrc

loglevel = "http" 
registry = "https://registry.npm.taobao.org/" 

; node bin location = /usr/local/soft/node-v14.17.1-linux-x64/bin/node
; cwd = /data/vue/vue3index
; HOME = /home/liuhongdi
; Run `npm config ls -l` to show all defaults.

已生效

 

三,查看当前node/npm的版本:

node:

liuhongdi@lhdpc:/data/vue/vue3index$ node --version
v14.17.1

npm:

liuhongdi@lhdpc:/data/vue/vue3index$ npm --version
7.20.5

 

posted @ 2021-08-12 15:38  刘宏缔的架构森林  阅读(550)  评论(0编辑  收藏  举报