Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Can't get Verdaccio packages from UPM

Discussion in 'Package Manager' started by james580, Jan 22, 2022.

  1. james580

    james580

    Joined:
    Aug 9, 2017
    Posts:
    19
    I got a new M1 MacBook Pro a few days ago, and have been having problems with Verdaccio and the UPM, but it works just fine on my old Mac. (which has macOS Catalina)

    When Verdaccio is running (on localhost:4873) and I try to view my packages in UPM I get the error:
    "[Package Manager Window] Unable to perform online search: Cannot connect to 'localhost:4873' (error code: ECONNREFUSED). Verify your environment firewall policies allow connection to this host name. If your system is behind a proxy, verify your proxy environment variables (HTTP_PROXY and HTTPS_PROXY) are properly set."

    I don't have any proxy environment variables set to my knowledge, and the .npmrc, .upmconfig.toml, and the verdaccio config.yaml files are basically the same (from both computers).

    If anyone could help I would really appreciate it.
     
    Last edited: Jan 22, 2022
  2. jerome-lacoste

    jerome-lacoste

    Joined:
    Jan 7, 2012
    Posts:
    206
    I had the same issue, I solved it by adding
    Code (CSharp):
    1. listen:
    2.   - 0.0.0.0:4873
    to my verdaccio config
     
  3. james580

    james580

    Joined:
    Aug 9, 2017
    Posts:
    19
    I think port 0000 is for allowing other computers to access packages from your computer. I had tried anyways and I don't think it worked for both publishing packages and downloading them to my Unity project. The way I solved it was, for some reason
    Code (CSharp):
    1. listen:
    2.   - 127.0.0.1:4873
    works for downloading my verdaccio packages into Unity, and commenting out that line works for publishing packages. So whenever I want to do one or the other I just have to open my config.yaml file and (un)comment that line. Kind of annoying but it works for me.
     
  4. AmitChBB

    AmitChBB

    Joined:
    Feb 16, 2021
    Posts:
    36
    Hey, any news regarding this? I ran into exactly the same problem, and introducing this `listen` to the config left me with the same situation where I have to continuously comment/uncomment.
    Did you find a way to fix this or bypass this? Thanks.
     
  5. james580

    james580

    Joined:
    Aug 9, 2017
    Posts:
    19
    I had been commenting/uncommenting that line for over a year, it was tedious but I got used to it. That is until just a few weeks ago I decided to try `npm publish` without commenting out the line and it magically worked. So I'm not sure if it was a macOS update that fixed it or some other change. So I'd maybe just recommend updating macOS to the latest version if you haven't, and Verdaccio, python3, etc. (Sorry that's not more helpful).

    As a side note, one reason why it's not *too much of a pain to comment/uncomment is that, if I'm making several changes to a package that's inside of a project, I often reference it directly in the project manifest.json. Then once I've made enough changes to it, I'll do an update (npm publish). Again, sorry that's not the answer you needed, but hopefully you figure it out.
     
  6. AmitChBB

    AmitChBB

    Joined:
    Feb 16, 2021
    Posts:
    36
    Thanks for your reply! It was helpful.
     
    james580 likes this.