nix-npm-buildpackage icon indicating copy to clipboard operation
nix-npm-buildpackage copied to clipboard

Cannot resolve git dependencies

Open evanjs opened this issue 3 years ago • 1 comments

I have a project that utilizes @biesbjerg/ngx-translate-extract and one of the dependencies sometimes references a git commit (github:lenchvolodymyr/flat#ffe77ef).

This is a development dependency, but the below specification in package-lock.json causes the build to fail, as git is not in the PATH, and there is no network access, anyway.

node_modules/@biesbjerg/ngx-translate-extract:
"node_modules/@biesbjerg/ngx-translate-extract": {
      "version": "4.2.0",
      "resolved": "http://172.16.0.208:8080/nexus/repository/npm/@biesbjerg/ngx-translate-extract/-/ngx-translate-extract-4.2.0.tgz",
      "integrity": "sha512-MY33zFNqlZFPv4RU5rCdyuvINwmwhWcGrxYy0MoiXsqLkqoly4xCt7cJhdSh3XhTi85dDi//hGynxGc5WzXnbA==",
      "bundleDependencies": [
        "flat"
      ],
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "@angular/compiler": "^8.2.6",
        "@phenomnomnominal/tsquery": "^3.0.0",
        "boxen": "^4.1.0",
        "colorette": "^1.1.0",
        "flat": "github:lenchvolodymyr/flat#ffe77ef",
        "gettext-parser": "^4.0.2",
        "glob": "^7.1.4",
        "mkdirp": "^0.5.1",
        "path": "^0.12.7",
        "terminal-link": "^2.0.0",
        "typescript": "^3.6.3",
        "yargs": "^14.0.0"
      },
  ...
Error produced by nix-npm-buildpackage:
frontend> building npm cache
frontend> building node_modules
frontend> npm ERR! code ENOENT5mextract [email protected] extracted tK
frontend> npm ERR! syscall spawn git
frontend> npm ERR! path git
frontend> npm ERR! errno ENOENT
frontend> npm ERR! enoent Error while executing:
frontend> npm ERR! enoent undefined ls-remote -h -t ssh://[email protected]/lenchvolodymyr/flat.git
frontend> npm ERR! enoent
frontend> npm ERR! enoent
frontend> npm ERR! enoent spawn git ENOENT
frontend> npm ERR! enoent This is related to npm not being able to find a file.

Furthermore, the package-lock.json seems to reference the dependency regardless of NODE_ENV (e.g. prod), npm i --only-prod, etc., so I am having issues directing it to a non-git commit to work around this issue.

If there is a way to do so with the current state of the repository, that would be helpful at this point.

Not sure how much work it would take to support fetching node dependencies from git repositories, assuming it is not supported at the moment, as this issue seems to indicate.

evanjs avatar Aug 17 '21 19:08 evanjs

Oops. Did not see https://github.com/serokell/nix-npm-buildpackage/pull/34. It doesn't seem to work with the PR just yet, however.

evanjs avatar Aug 17 '21 19:08 evanjs