newghost
V2EX  ›  Node.js

NPM 越来越慢, 真是伤不起

  •  1
     
  •   newghost · Aug 5, 2015 · 9843 views
    This topic created in 4108 days ago, the information mentioned may be changed or developed.
    以前的一个开源网站项目是直接通过NPM安装的,最近有些人反应装不上。

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

    只能把整个目录连同node_modules打成一个zip包发布到了Github上……
    23 replies  •  2017-03-27 16:50:30 +08:00
    zrp1994
    zrp1994
    Aug 5, 2015
    1
    试试cnpm吧
    neone
    neone
    Aug 5, 2015
    2
    可以试试淘宝的镜像。http://npm.taobao.org/
    newghost
    newghost
    OP
    Aug 5, 2015
    3
    @zrp1994 关键是这一句就有可能运行不过

    $ npm install -g cnpm --registry=https://registry.npm.taobao.org
    atan
    atan
    Aug 5, 2015
    4
    已经习惯命令行用proxychains4了
    sjtlqy
    sjtlqy
    Aug 5, 2015
    5
    日了他
    czheo
    czheo
    Aug 5, 2015 via iPhone
    6
    感觉比gem快
    pengfei
    pengfei
    Aug 5, 2015
    7
    你的怎么这么黑 一进来 画风转的太快 晃眼
    lujiajing1126
    lujiajing1126
    Aug 5, 2015
    8
    @newghost 不会啊,定义registry就会很快呀
    TakanashiAzusa
    TakanashiAzusa
    Aug 5, 2015
    9
    现在都是cnpm装了。。
    newghost
    newghost
    OP
    Aug 5, 2015
    10
    @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
    iwege
    Aug 5, 2015
    11
    @newghost 可以直接config set 来设置就好了,不用安装cnpm。

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

    官方源经常 校验sum出错

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

    要稳定用,挂VPN或者设置HTTP_PROXY吧
    Andy1999
    Andy1999
    Aug 5, 2015 via iPhone
    15
    开个Shadowsocks
    jiangzhuo
    jiangzhuo
    Aug 5, 2015
    16
    是你网不好吧,我记得NPM最近刚升级过硬件啊
    kawaiiushio
    kawaiiushio
    Aug 5, 2015
    17
    @newghost 装不了 cnpm 的包就 alias 吧
    xuhaoyangx
    xuhaoyangx
    Aug 6, 2015
    18
    挂上精品网的线路,瞬间复活
    lalawow
    lalawow
    Aug 6, 2015
    19
    可能是要科学的上网才行
    alsotang
    alsotang
    Aug 6, 2015
    20
    cnpm
    zonghua
    zonghua
    Aug 6, 2015 via iPhone
    21
    @alsotang 老大真活跃,有些问题不知道如何科学提问🙊
    vix
    vix
    Aug 10, 2015
    22
    最近正好在弄这个... 除了cnpm之外, 发现可以在内网机器上搭个sinopia, . 能cache包, 也能发布自己的module. 如果还是不行只能给那个机器上科学上网了...抛砖引玉...
    heaventear
    heaventear
    Mar 27, 2017
    23
    一劳永逸的解决方法是挂个梯子,我用的是天路加速器,效果挺好, https://91tianlu.com
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2382 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 63ms · UTC 15:25 · PVG 23:25 · LAX 07:25 · JFK 10:25
    ♥ Do have faith in what you're doing.