V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
fengyj
V2EX  ›  问与答

npm publish 遇见的问题

  •  
  •   fengyj · Jan 28, 2018 · 2948 views
    This topic created in 3023 days ago, the information mentioned may be changed or developed.

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

    9 replies    2018-01-28 19:08:31 +08:00
    fengyj
        1
    fengyj  
    OP
       Jan 28, 2018
    ...
    hronro
        2
    hronro  
       Jan 28, 2018 via iPhone
    npm 不会走 ss 的代理的,你需要自己去 npmrc 里设置
    fengyj
        3
    fengyj  
    OP
       Jan 28, 2018
    npm 不会自己走 ss 的。尴尬。
    话说你有没有什么教程链接吗?我是最近接触 nodejs,有点不太会。
    Kilerd
        4
    Kilerd  
       Jan 28, 2018
    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 怎么设置代理没有
    fengyj
        5
    fengyj  
    OP
       Jan 28, 2018
    npm config set proxy=http://127.0.0.1:1080
    试了没用诶。走的 ss 代理。因为 ss 好像走 http 代理。
    @Kilerd
    hxsf
        6
    hxsf  
       Jan 28, 2018 via iPhone
    把 log 贴到 gist 然后 append gist 地址
    fengyj
        7
    fengyj  
    OP
       Jan 28, 2018
    hxsf
        8
    hxsf  
       Jan 28, 2018   ❤️ 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

    ```
    fengyj
        9
    fengyj  
    OP
       Jan 28, 2018
    @hxsf 恩。问题已解决。是上次关机没注意(具体我也不太清楚),发现重启后又可以了。
    估摸是.npmrc 文件的问题。不过谢谢啦。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3038 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 13:26 · PVG 21:26 · LAX 06:26 · JFK 09:26
    ♥ Do have faith in what you're doing.