Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Official Using GitHub Packages Registry with Unity Package Manager

Discussion in 'Package Manager' started by okcompute_unity, Apr 5, 2020.

  1. jason_yak

    jason_yak

    Joined:
    Aug 25, 2016
    Posts:
    514
    I'd also throw in a vote for this to be fixed, have been following this thread for a long time now hoping to hear news of improved github support for packages.

    I've had to create my own package manager of sorts to be able to update dozens of projects so they point to a particular git commit by parsing the package manifest files and splicing in commit hash id's. It works, but it's a cumbersome process to manage.
     
  2. Matheus_Moura

    Matheus_Moura

    Joined:
    Aug 8, 2015
    Posts:
    2
  3. LE-Peter

    LE-Peter

    Joined:
    Sep 15, 2020
    Posts:
    44

    I've done this and can publish packages to gitlab, however, doing npm view in cmd prompt uses an incorrect URL.

    I get this, because it's using the wrong url.
    The logs show that npm loads (or tries to?) configs from 4 different places
    These three locations do not exist:
    C:\Users\MyUser\AppData\Roaming\npm\node_modules\npm\npmrc
    D:\<mypackage location>\.npmrc
    c:\Program Files\nodejs\etc\npmrc

    This exists and is configured how the quoted post states
    C:\Users\MyUser\.npmrc

    What am I missing?
     
  4. IroxGames

    IroxGames

    Joined:
    Feb 8, 2020
    Posts:
    16
    not sure exactly, but you can check your package registry on the gitlab website.
    If it's listed there you can use it in Unity
     
  5. Adrian

    Adrian

    Joined:
    Apr 5, 2008
    Posts:
    1,061
    IIRC you can only use project-level packages, not instance-level ones. Reason is that Unity does not support scoped packages and GitLab requires you to use scopes for instance-level packages.
     
  6. LE-Peter

    LE-Peter

    Joined:
    Sep 15, 2020
    Posts:
    44
    I'm using the packages in Unity fine. I just can't do npm view in the command prompt, it uses the wrong URL. I also use this command in a editor tool, which allows me to check the published version with the local, change the version number and publish from within the Editor.

    The issue is with npm