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

Configure Unity Package Manager global cache location

Discussion in 'Package Manager' started by okcompute_unity, Mar 25, 2019.

  1. okcompute_unity

    okcompute_unity

    Joined:
    Jan 16, 2017
    Posts:
    756
    Last edited: Apr 16, 2019
    havokentity and codestage like this.
  2. Nyanpas

    Nyanpas

    Joined:
    Dec 29, 2016
    Posts:
    406
    Where do I set these?
     
  3. Nyanpas

    Nyanpas

    Joined:
    Dec 29, 2016
    Posts:
    406
    Oh, I am stupid. Thank you. :3c
     
  4. Deleted User

    Deleted User

    Guest

    Not much helpful.

    I followed this tutorial here in order to change the location of the npm and packages folders.

    To do that (Windows 7 SP1 for me but I suspect that the process is about the same for W8 and W10):
    1. create two new variables in "Environment Variables/System Variables" (do not modify any existing variable as mentioned in the tutorial!!!),
    2. affect them the path where you want them to be stored. You do not need to create the directories, just enter the new path and Unity will create them,
    3. if necessary, quit the hub entirely from the system tray and Unity,
    4. restart the Hub and Unity and let Unity rebuild the cache.
    Once done:
    • delete the npm and packages folders in "C:\Users\Username\AppData\Local\Unity\cache",
    • start your projects and make sure all the packages you are using are there.
    Here are the new variables I created; everything went fine.

    Capture_3.JPG

    Capture_4.JPG
     
  5. harlandpj

    harlandpj

    Joined:
    Jul 15, 2020
    Posts:
    6
    Will try this now, as the Unity "it shouldn't be a problem with storing stuff on the C: Drive...", well yes it is, my Windows SSD C: drive now has exactly ZERO bytes free and can't download any more assets, despite the fact I have around 9-10TB free on other drives.... hmmm!
     
    Gamba04, matt1981111 and Crwth like this.
  6. wellthisisfunsoftware

    wellthisisfunsoftware

    Joined:
    Oct 12, 2020
    Posts:
    2
    Full hero points for this!! You are a life saver. My C: disk is constantly filling up because of the caches. This worked exactly as you described, relocating my old caches onto a spare disk!
     
    brianlin1992 likes this.
  7. vTimePawel

    vTimePawel

    Joined:
    Aug 1, 2017
    Posts:
    32
    To add to above:
    As a speed up to above, copy contents of your npm and packages folders before opening unity to the new locations and delete them from AppData. You can tell it worked if Unity doesn't recreate npm folder in old location.
    Quitting Hub from the tray is also a crucial step
     
    Gravesend likes this.
  8. gazram

    gazram

    Joined:
    Sep 18, 2017
    Posts:
    3
    This is brilliant, worked a charm, thanks for your help.
     
    Gravesend likes this.
  9. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,539
    You can set the package cache location under Preferences these days:
    upload_2024-2-20_12-18-45.png

    Not sure which version introduced this, might have been 2022. It's definitely in 2023.