NPM 越来越慢, 真是伤不起

2015-08-05 09:06:35 +08:00
 newghost
以前的一个开源网站项目是直接通过NPM安装的,最近有些人反应装不上。

这几天试了一下,在公司几乎没有安装成功过; 在家也要试好几次下载很久…… 其实依赖也很少。

只能把整个目录连同node_modules打成一个zip包发布到了Github上……
8492 次点击
所在节点    Node.js
23 条回复
zrp1994
2015-08-05 09:10:34 +08:00
试试cnpm吧
neone
2015-08-05 09:11:20 +08:00
可以试试淘宝的镜像。http://npm.taobao.org/
newghost
2015-08-05 09:13:29 +08:00
@zrp1994 关键是这一句就有可能运行不过

$ npm install -g cnpm --registry=https://registry.npm.taobao.org
atan
2015-08-05 09:14:05 +08:00
已经习惯命令行用proxychains4了
sjtlqy
2015-08-05 09:16:21 +08:00
日了他
czheo
2015-08-05 10:39:55 +08:00
感觉比gem快
pengfei
2015-08-05 10:43:36 +08:00
你的怎么这么黑 一进来 画风转的太快 晃眼
lujiajing1126
2015-08-05 10:48:51 +08:00
@newghost 不会啊,定义registry就会很快呀
TakanashiAzusa
2015-08-05 10:49:27 +08:00
现在都是cnpm装了。。
newghost
2015-08-05 11:08:31 +08:00
@lujiajing1126

一直在转呀转呀转……



Welcome to Git (version 1.8.4-preview20130916)


Run 'git help git' to display the help index.
Run 'git help <command>' to display help for specific commands.

I304716@PVGD50816637A /D/
$ npm install -g cnpm --registry=https://registry.npm.taobao.org
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodejs\\node_modules\\npm\\b
in\\npm-cli.js" "install" "-g" "cnpm" "--registry=https://registry.npm.taobao.org"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! code ENOENT
npm ERR! errno ENOENT
npm ERR! syscall getaddrinfo

npm ERR! enoent getaddrinfo ENOENT
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR! d:\ourjs-ppt\npm-debug.log

I304716@PVGD50816637A /D/
$ npm install -g cnpm --registry=https://registry.npm.taobao.org
/
iwege
2015-08-05 11:23:54 +08:00
@newghost 可以直接config set 来设置就好了,不用安装cnpm。

btw,你这网络是电信还是联通还是移动的?
plantain
2015-08-05 12:02:17 +08:00
Coyote
2015-08-05 12:02:47 +08:00
同感.....正在鼓捣的时候就各种问题, 很多时候淘宝源不同步, 用淘宝的方法同步太费劲额

官方源经常 校验sum出错

服了, 同求方案
denghongcai
2015-08-05 13:07:38 +08:00
cnpm不会影响node-gyp解决编译依赖时下载node源码的路径,网络问题经常导致下载回来的tar.gz校验失败……

要稳定用,挂VPN或者设置HTTP_PROXY吧
Andy1999
2015-08-05 13:11:54 +08:00
开个Shadowsocks
jiangzhuo
2015-08-05 15:05:31 +08:00
是你网不好吧,我记得NPM最近刚升级过硬件啊
kawaiiushio
2015-08-05 16:59:03 +08:00
@newghost 装不了 cnpm 的包就 alias 吧
xuhaoyangx
2015-08-06 00:00:36 +08:00
挂上精品网的线路,瞬间复活
lalawow
2015-08-06 09:27:50 +08:00
可能是要科学的上网才行
alsotang
2015-08-06 10:40:43 +08:00
cnpm

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/210869

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX