Thursday, 8 August 2019

Npm install doesn't download dependency assets from Git LFS on Ubuntu

Background

I have a project that's split into several smaller projects with one main project that downloads the others as dependencies of the main project.

I'm using Gitlab to host my projects in private repositories, using deploy tokens to allow npm install to download them.

The dependencies are added to the main project using the following format in package.json:

git+https://name:token@gitlab.com/group/project.git

Problem

On Windows when I do a git clone of my main project and run npm install, it does download all the assets using Git LFS, but on Ubuntu the assets aren't getting downloaded. If I check the contents of all the files tracked by Git LFS all I get is the information Git LFS placeholder. I'm using identical commands and software versions on Windows and Ubuntu, but with different results.

I've tried:

  • Updating to same versions of Node(10.16.0) and Npm(6.10.2) on both Windows and Ubuntu
  • Updating to the latest versions of Node and Npm (I had to stick to version 10.x for Node because of some dependencies not working with 12.x)
  • Adding a .lfsconfig file that points to the repository as described in the following issue: https://github.com/npm/npm/issues/11151
  • Updating Git to the latest version (2.21 on Windows and 2.22 on Ubuntu)

Current workaround

Currently I'm cloning the main project then manually cloning my dependencies into node_modules so that they're all proper git repositories so that I can then use git lfs pull in them. It works, but it's not how it should work, especially not since it's working as it should on Windows.

Question

Why is npm install handling Git LFS differently for dependencies on Ubuntu vs Windows? How do I get npm install to work properly with Git LFS on dependencies, is there a settings somewhere I need to change to e.g. enforce Git LFS downloading?



from Npm install doesn't download dependency assets from Git LFS on Ubuntu

No comments:

Post a Comment