V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
huiyifyj
V2EX  ›  问与答

npm publish 遇见的问题

  •  
  •   huiyifyj · 2018-01-28 13:44:12 +08:00 · 2497 次点击
    这是一个创建于 2279 天前的主题,其中的信息可能已经有所发展或是发生改变。

    npm publish遇到这种问题。
    网络不好?不会啊。
    我信号挺好的,而且还开了 ss 全局代理,但是依旧这样显示。代理设置的没问题啊。 npm-question.png 有谁了解╮(╯_╰)╭么?

    9 条回复    2018-01-28 19:08:31 +08:00
    huiyifyj
        1
    huiyifyj  
    OP
       2018-01-28 13:51:33 +08:00
    ...
    hronro
        2
    hronro  
       2018-01-28 13:56:41 +08:00 via iPhone
    npm 不会走 ss 的代理的,你需要自己去 npmrc 里设置
    huiyifyj
        3
    huiyifyj  
    OP
       2018-01-28 13:59:40 +08:00
    npm 不会自己走 ss 的。尴尬。
    话说你有没有什么教程链接吗?我是最近接触 nodejs,有点不太会。
    Kilerd
        4
    Kilerd  
       2018-01-28 14:45:07 +08:00
    In most cases you are behind a proxy or have bad network settings

    If you are behind a proxy, please make sure that the proxy config is set properly. See npm help config


    你试过 npm help config 怎么设置代理没有
    huiyifyj
        5
    huiyifyj  
    OP
       2018-01-28 15:30:12 +08:00
    npm config set proxy=http://127.0.0.1:1080
    试了没用诶。走的 ss 代理。因为 ss 好像走 http 代理。
    @Kilerd
    hxsf
        6
    hxsf  
       2018-01-28 15:46:25 +08:00 via iPhone
    把 log 贴到 gist 然后 append gist 地址
    huiyifyj
        7
    huiyifyj  
    OP
       2018-01-28 15:53:39 +08:00
    hxsf
        8
    hxsf  
       2018-01-28 17:51:56 +08:00   ❤️ 1
    @huiyifyj #7 看起来是网络问题
    你是 linux 机器, 试试这个

    ``` shell

    npm config delete proxy

    export HTTP_PROXY=http://127.0.0.1:1080
    export HTTPS_PROXY=http://127.0.0.1:1080
    npm config set http-proxy=http://127.0.0.1:1080
    npm config set https-proxy=http://127.0.0.1:1080


    # 先试一下能不能访问
    curl -Ssv https://registry.npmjs.org/proxy-pac.js
    # ok 的话 在提交一次试试
    npm publish

    ```
    huiyifyj
        9
    huiyifyj  
    OP
       2018-01-28 19:08:31 +08:00
    @hxsf 恩。问题已解决。是上次关机没注意(具体我也不太清楚),发现重启后又可以了。
    估摸是.npmrc 文件的问题。不过谢谢啦。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   978 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 21:47 · PVG 05:47 · LAX 14:47 · JFK 17:47
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.