执行 npm install 会发现很慢,可以在安装时手动指定从哪个镜像服务器获取资源,我使用的是阿里巴巴在国内的镜像服务器。

命令如下:

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

避免每次安装都需要--registry参数,可以使用如下命令进行永久设置

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

执行完命令后,会发现~/.npmrc文件中会加入一条:registry=https://registry.npm.taobao.org

或可以直接编辑  ~/.npmrc 加入下面内容

registry = https://registry.npm.taobao.org

npm info underscore (如果上面配置正确这个命令会有字符串response)

{ name: 'underscore',description: 'JavaScript\'s functional programming helper library.','dist-tags': { latest: '1.8.3', stable: '1.8.3' },maintainers: [ 'jashkenas <jashkenas@gmail.com>','jridgewell <justin+npm@ridgewell.name>' ],time: { modified: '2017-03-27T10:13:57.000Z',created: '2011-11-14T20:28:47.115Z','1.8.3': '2015-04-02T15:32:54.520Z','1.8.2': '2015-02-22T14:14:32.785Z','1.8.1': '2015-02-20T03:20:05.519Z','1.8.0': '2015-02-20T00:14:01.838Z','1.7.0': '2014-08-26T22:16:25.836Z','1.6.0': '2014-02-10T21:14:55.838Z','1.5.2': '2013-09-07T13:00:28.048Z','1.5.1': '2013-07-08T08:38:10.051Z','1.5.0': '2013-07-06T18:05:58.721Z','1.4.4': '2013-01-30T02:12:42.969Z','1.4.3': '2012-12-04T18:47:36.401Z','1.4.2': '2012-10-07T03:05:02.986Z','1.4.1': '2012-10-01T17:20:22.595Z','1.4.0': '2012-09-27T22:02:55.267Z','1.3.3': '2012-04-10T14:43:48.089Z','1.3.2': '2012-04-09T18:38:14.345Z','1.3.1': '2012-01-23T22:57:36.474Z','1.3.0': '2012-01-11T16:41:38.459Z','1.2.4': '2012-01-09T17:23:14.818Z','1.0.4': '2011-12-07T15:12:18.045Z','1.2.3': '2011-12-07T15:12:18.045Z','1.0.3': '2011-12-07T15:12:18.045Z','1.2.1': '2011-12-07T15:12:18.045Z','1.2.0': '2011-12-07T15:12:18.045Z','1.1.7': '2011-12-07T15:12:18.045Z','1.1.0': '2011-12-07T15:12:18.045Z','1.1.5': '2011-12-07T15:12:18.045Z','1.1.4': '2011-12-07T15:12:18.045Z','1.1.3': '2011-12-07T15:12:18.045Z','1.1.2': '2011-12-07T15:12:18.045Z','1.1.1': '2011-12-07T15:12:18.045Z','1.1.6': '2011-12-07T15:12:18.045Z','1.2.2': '2011-11-14T20:28:47.115Z' },users: { mvolkmann: true,lancehunt: true,mikl: true,linus: true,vasc: true,bat: true,dmalam: true,mbrevoort: true,danielr: true,rsimoes: true,tellnes: true,jharding: true,fgribreau: true,tylerstalder: true,pid: true,graemef: true,gillesruppert: true,travishorn: true,m42am: true,bencevans: true,Scryptonite: true,konklone: true,esp: true,bryanburgers: true,ehershey: true,freethenation: true,megadrive: true,dannydulai: true,lupomontero: true,'cj.nichols': true,dbrockman: true,maxmaximov: true,hyqhyq_3: true,zonetti: true,cparker15: true,lemulot: true,mlowe: true,chilts: true,shanewholloway: true,elgs: true,eins78: true,awaterma: true,moonpyk: true,raitucarp: true,victorquinn: true,davidgaya: true,netroy: true,'everywhere.js': true,tigefa: true,spekkionu: true,pana: true,mhaidarh: true,einfallstoll: true,mpinteractiv: true,simloovoo: true,darosh: true,landau: true,cedrickchee: true,tpwk: true,claveren: true,xtopher: true,gammasoft: true,lomatek: true,'thomas-so': true,oliversalzburg: true,nosch: true,rod: true,vegera: true,clintonhalpin: true,seldo: true,priyaranjan: true,cilindrox: true,cheeseen: true,rrobayna: true,rockbot: true,casoetan: true,ajduke: true,protonss: true,mgesmundo: true,bosspj: true,rckbt: true,zeusdeux: true,jetsetty: true,evkline: true,bcoe: true,nbu: true,tehdb: true,obihann: true,wangxian: true,ericlondon: true,lanceball: true,funroll: true,leventkaragol: true,beyoung: true,axelav: true,davidhalldor: true,cwonrails: true,rnbwd: true,cocopas: true,imnicosuarez: true,furkanom: true,andydrew: true,mrmakeit: true,mmierswa: true,jasonw: true,adamk: true,runningtalus: true,sironfoot: true,ezhi: true,suomiton: true,uris77: true,ksnieck: true,fill: true,nithanaroy: true,abalandin: true,jasonweng: true,zenanyoo: true,djbrandl: true,davidrlee: true,dereknelson: true,frk1705: true,nohponex: true,thitinun: true,pilsy: true,lpgray: true,tchey: true,arrc: true,skinnybrit51: true,tmypawa: true,tsangint: true,smashingeric: true,dercoder: true,slahav: true,mhwchung: true,davidrobles: true,moxiaohe: true,truongpv: true,gregoryteach: true,goblindegook: true,tommyjs7: true,adammcarth: true,atd: true,sroccaserra: true,yourhoneysky: true,jashkenas: true,eliagrady: true,jits: true,lukecarrier: true,knoxpayments: true,kingcron: true,morewry: true,karmadude: true,kungkk: true,johno: true,henryfour: true,'augusto.altman': true,jesus81: true,mstennett: true,cbowdon: true,hrmoller: true,megawac: true,hkbarton: true,'richard.webb': true,minchnew: true,kickthesky: true,alexahdp: true,bkimminich: true,maobean: true,windhamdavid: true,piecioshka: true,l0n9h02n: true,wxnet: true,genediazjr: true,oakley349: true,ascheink: true,lellansin: true,cwhopkins: true,dgarlitt: true,congcong: true,avinashkoyyana: true,rorygreig: true,macluvin: true,ryanj: true,jerryzou: true,swak: true,gdbtek: true,themanspeaker: true,stennettm: true,netzflechter: true,richarddavenport: true,thorsson: true,kruemelo: true,porkbits: true,taekgeun: true,ikoala: true,kenjisan4u: true,eterna2: true,excentric: true,indexzero: true,mnemr: true,wangnan0610: true,jezzalaycock: true,midknight41: true,devonoel: true,caligone: true,f124275809: true,greendwin: true,io2work: true,icflorescu: true,aitorllj93: true,batosai: true,stuligan: true,sametsisartenep: true,craigsapp: true,infinitycbs: true,tkhemani: true,andreaspag: true,yasinaydin: true,pnevares: true,princemaple: true,haeck: true,j3kz: true,pughpugh: true,jaggedsoft: true,mathieuancelin: true,sobering: true,vchouhan: true,goodseller: true,mccarter: true,wambulance: true,ysk8: true,zambon: true,skyinlayer: true,joeyblue: true,jostw: true,dpkg: true,broxmgs: true,chharvey: true,seanjh: true,plord: true,vboctor: true,jmm23: true,rugare: true,blackoperat: true,alphavibe: true,sharper: true,keeyanajones: true,subchen: true,dongxu: true,risyasin: true,rbartoli: true,lucasmciruzzi: true,jakemiller: true,huntie: true,itonyyo: true,jmshahen: true,minghe: true,chadwatson: true,klipsil: true,huytard: true,orlenka: true,makediff: true,sbrajesh: true,dac2205: true,dlaume: true,dolymood: true,sanketss84: true,chriscalo: true,richfoxton: true,'johnny.young': true,cycomachead: true,jimkropa: true,damianof: true,sonhuytran: true,subso: true,thepanuto: true,imchale: true,leejefon: true,ernie55ernie: true,robermac: true,sezgin: true,cestrensem: true,bpatel: true,stevenlothrop: true,karlbateman: true,fvcproductions: true,freshlogic: true,kurtz1993: true,amaynut: true,jqcdq8: true,yogapan: true,maxime1992: true,'2dxgujun': true,dbck: true,warapitiya: true,nice_body: true,jeffb_incontact: true,wkaifang: true,rvanmil: true,ericmash: true,vishwasc: true,pacotole: true,kelerliao: true,arnoldstoba: true,matthewbauer: true,romelperez: true,nicwaller: true,mamalat: true,jozias: true,pdedkov: true,edwin_estrada: true,jasonevrtt: true,sky3r: true,gollojs: true,charlestati: true,naokie: true,kparkov: true,linuxwizard: true,zhoutk: true,jkrenge: true,alectic: true,liushoukai: true,xeoneux: true,wmarra: true,andersonsantos: true,kobleistvan: true,frankxin: true,crazyjingling: true,eviratec: true,nickeltobias: true,adonai: true,awddwaadzz: true,pandao: true,dpjayasekara: true,ffi: true,nystul: true,tylerm: true,josejaguirre: true,maur1th: true,piyushmakhija: true,jiku: true,danielbankhead: true,'thomas.miele': true,clisun: true,'leandro.rosagf': true,jerous: true,dittodhole: true,itskdk: true,wulfgarpro: true,richardcfelix: true,digitalextremist: true,crabb: true,sparkrico: true,cfleschhut: true,rwhogg: true,thiagoh: true,hacksalot: true,shlomi: true,tobiasnickel: true,gr4vy: true,corca: true,wfcookie: true,ychang225: true,davidbraun: true,lukaserat: true,jyounce: true,bhenav: true,ragex1337: true,timdp: true,novalu: true,doptrois: true,arbazsiddiqui: true,donvercety: true,miketr2000: true,demod: true,kshvmdn: true,qddegtya: true,hughescr: true,lionet: true,ceogavin: true,wander_lp: true,demopark: true,nexume: true,apehead: true,vamakoda: true,prestorondo: true,markoni: true,hgbabu: true,philiiiiiipp: true,lex_nel: true,coalesce: true,vinta: true,'roman-io': true,sternelee: true,lisafrench: true,pruettti: true,dnik: true,dmikam: true,jasonwang1888: true,asm2hex: true,kimkee: true,aldofunes: true,dabin: true,ezeikel: true,mseminatore: true,monjer: true,potnox: true,ahadb: true,garustar: true,martii: true,riteshg: true,'tin-lek': true,heyimeugene: true,binq: true,fasdgoc: true,jrockowitz: true,icerainnuaa: true,akinjide: true,kaapex: true,apwn: true,ekmpls: true,merrickp: true,qinbx: true,amdsouza92: true,hyokosdeveloper: true,muroc: true,xxsnake28: true,davidcaballeroj: true,almgwary: true,sopov: true,mryeol: true,mcl: true,faraoman: true,frankwinter: true,vzonys: true,samersm: true,prashanta: true,gejiawen: true,ungurys: true,razr9: true,'ivan.marquez': true,brainpoint: true,apopek: true,roxnz: true,'alex-the-dev': true,katsos: true,ironmaniiith: true,rocket0191: true,shahyar: true,ramzesucr: true,zanner: true,degouville: true,tmurngon: true,pfuri: true,danielbayley: true,krabello: true,dburdese: true,eijs: true,erniep888: true,prbsas: true,'alexey-mish': true,mobeicaoyuan: true,luiscauro: true,onursumer: true,iandstanley: true,mojaray2k: true,fahadjadoon: true,igorsetsfire: true,wgao19: true,ahshum: true,'langri-sha': true,wenhsiaoyi: true,'a.sanchez': true,adilalam: true,danielmihai: true,adamdreszer: true,bapinney: true,tunjos: true,rylan_yan: true,austinbillings: true,bobxuyang: true,charlietango592: true,wearevilla: true,prime156: true,ahmetertem: true,pixelcraft: true,jad96: true,morogasper: true,skellertor: true,anoubis: true,bengineer: true,jasonleewilson: true,ukrbublik: true,onursimsek: true,arvindrsingh: true,xmalinov: true,cvc: true,olonam: true,madalozzo: true,'s.well': true,sprybear: true,chinawolf_wyp: true,lunaroyster: true,warcrydoggie: true,abernier: true,vinnyfonseca: true,junos: true,blackrocky: true,icodeforcookies: true,noncreature0714: true,menoncello: true,anipendakur: true,nilz3ro: true,fabrianibrahim: true,iceriver2: true,toszter: true,blakeredwolf: true,heartnett: true,maxwelldu: true,adammc: true,modood: true,lusai: true,sibawite: true,gwilison: true,valenwave: true,pddivine: true,clivend: true,maycon_ribeiro: true,zhbyak47: true,yifan: true,manojkhannakm: true,julianomontini: true,sahlzen: true,asj1992: true,rdca84: true,billl89: true,anaumidis: true,ericteng177: true,thangakumar: true,neo1: true,hehaiyang: true,infernocloud: true,largepuma: true,krostyslav: true,waspar: true,marinear212: true,'npm-packages': true,tonerbarato: true,deepakpund: true,iamninad: true,vision_tecnologica: true,gresite_piscinas: true,suryasaripalli: true,kwcjr: true,colageno: true,zwwggg: true,aaamitsingh: true,vapeadores: true,dangmin: true },author: 'Jeremy Ashkenas <jeremy@documentcloud.org>',repository: { type: 'git',url: 'git://github.com/jashkenas/underscore.git' },versions: [ '1.0.3','1.0.4','1.1.0','1.1.1','1.1.2','1.1.3','1.1.4','1.1.5','1.1.6','1.1.7','1.2.0','1.2.1','1.2.2','1.2.3','1.2.4','1.3.0','1.3.1','1.3.2','1.3.3','1.4.0','1.4.1','1.4.2','1.4.3','1.4.4','1.5.0','1.5.1','1.5.2','1.6.0','1.7.0','1.8.0','1.8.1','1.8.2','1.8.3' ],homepage: 'http://underscorejs.org',bugs: { url: 'https://github.com/jashkenas/underscore/issues' },license: 'MIT',keywords: [ 'util', 'functional', 'server', 'client', 'browser' ],main: 'underscore.js',version: '1.8.3',devDependencies: { docco: '*',eslint: '0.6.x',karma: '~0.12.31','karma-qunit': '~0.1.4','qunit-cli': '~0.2.0','uglify-js': '2.4.x' },scripts: { test: 'npm run test-node && npm run lint',lint: 'eslint underscore.js test/*.js','test-node': 'qunit-cli test/*.js','test-browser': 'npm i karma-phantomjs-launcher && ./node_modules/karma/bin/karma start',build: 'uglifyjs underscore.js -c "evaluate=false" --comments "/    .*/" -m --source-map underscore-min.map -o underscore-min.js',doc: 'docco underscore.js' },files: [ 'underscore.js','underscore-min.js','underscore-min.map','LICENSE' ],gitHead: 'e4743ab712b8ab42ad4ccb48b155034d02394e4d',dist: { shasum: '4f3fb53b106e6097fcf9cb4109f2a5e9bdfa5022',size: 34172,noattachment: false, tarball: 'http://registry.npm.taobao.org/underscore/download/underscore-1.8.3.tgz' },directories: {},publish_time: 1427988774520 }

转载于:https://www.cnblogs.com/amunamuna/p/7531536.html

npm安装依赖太慢问题相关推荐

  1. mac系统升级后npm安装依赖报错gyp: No Xcode or CLT version detected

    mac更新系统后,npm安装依赖包报错如下: gyp: No Xcode or CLT version detected 原因: 缺少了XCODE的CLI(command-line tools )工具 ...

  2. 记一次npm安装依赖奇怪的gyp报python错误

    记一次npm安装依赖奇怪的gyp报python错误 @[TOC](记一次npm安装依赖奇怪的gyp报python错误 错误一 错误一解决 错误二 错误二解决 错误一 C:\Users\yuanz\De ...

  3. npm 安装依赖报错解决方法总结

    npm 安装依赖报错解决方法总结 参考文章: (1)npm 安装依赖报错解决方法总结 (2)https://www.cnblogs.com/ysxq/p/11658571.html (3)https: ...

  4. 解决国内NPM安装依赖速度慢问题

    不知道各位是否遇到这种情况,使用NPM(Node.js包管理工具)安装依赖时速度特别慢,为了安装Express,执行命令后两个多小时都没安装成功,最后只能取消安装,笔者20M带宽,应该不是我网络的原因 ...

  5. npm 安装依赖遇到的问题

    npm npm的服务器位于国外可能会影响安装 cnpm 淘宝团队做的国内镜像 // 安装 cnpm npm install cnpm -g --registry=https://registry.np ...

  6. 解决npm 安装依赖提示 Maximum call stack size exceeded问题

    问题场景:项目npm install 安装依赖时报错:Maximum call stack size exceeded. 解决思路: 1.删除node_modules重新npm install 2.清 ...

  7. npm安装依赖相关命令

    在前端项目中经常会用到npm安装一些依赖,但是有时我们对一些命令所起的作用不是很清晰. 所以专门在此记录一下,以供学习. npm install xxx:安装依赖到项目目录下,不会将模块依赖写入dev ...

  8. npm 编译慢_解决npm安装node-sass太慢及编译错误问题

    环境: win10 node v10.13.0 npm v6.4.1 背景: 最近vue项目使用sass,所以需要sass-loader,sass-loader依赖node-sass,还需安装node ...

  9. npm安装依赖包报错

    最近在新下载了一个项目,需要 npm i 下载依赖,,但是一直报错,, 首先用cnpm源下载 $ npm install -g npm npm ERR! code E500 npm ERR! 500 ...

最新文章

  1. numpy笔记整理 multivariate_normal(多元正态分布采样)
  2. python和access哪个实用_access和python学哪个
  3. r语言 图形一览_R语言统计与绘图:ggplot2图形组合布局
  4. 代码规范(一)——java篇
  5. CCF201412-1 门禁系统(100分)
  6. mysql延迟写入概念_三分钟了解MySQL的简单概念
  7. angular中使用其他模块severs使用失败
  8. xp系统打印机服务器win7连接不了,Win7无法共享xp打印机的解决方法
  9. 前工程师讲解:开关电源设计-LLC电源
  10. 掌握命令结构,详解monkey命令
  11. SFDC 日常经验积累
  12. 剪不断理还乱--C#重载/重写/覆盖
  13. 昨天睡眠质量记录70分
  14. SVG描边动画实现过程
  15. 2003下搭建easypanel(康乐)虚拟主机控制面板
  16. 如何从Big Sur恢复为macOS Catalina
  17. python语言是不是非开源语言_python是开元语言吗?
  18. iPad/iPhone如何设置充电提示音吖?
  19. 疫情何时结束?中国各城市首轮感染高峰期预测!(更新版)
  20. 华为汽车局丨华为“造”车,兵分两路

热门文章

  1. 基于SpringBoot软件工程专业教辅平台课程子系统
  2. 小tip: CSS3如何实现圆角的outline效果?
  3. 做事要方,做人要圆 .
  4. Stata数据处理:快速转换Wind数据-reshapewind
  5. 电脑账户进不去 被停用,PIN无法验证,如何进入电脑安全模式
  6. matlab仿真三相不平衡度,matlab调用openDSS进行三相不平衡潮流计算
  7. POJ--3579--查找第k大的值
  8. 究竟什么是服务器?起什么作用
  9. FFT—快速傅里叶变换算法——matlab(1)
  10. 软件设计师考试 | 第十一章 标准化和软件知识产权基础知识 | 知识产权基础知识