You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] npm 11.4.1 unable to install packages from git repo #8331
When there is dependency being installed from git repo(git+ssh), npm latest (v11.4.1) is not downloading the dependency.
The lock file also does not show the dependency being downloaded.
Please note that the dependency does get downloaded and installed properly in v11.2.0
Packages from git+ssh should get installed properly
Steps To Reproduce
Create a problematic package.json file with packages from git
npm i --verbose
npm throws error
npm warn reify invalid or damaged lockfile detected
npm warn reify please re-try this operation once it completes
npm warn reify so that the damage can be corrected, or perform
npm warn reify a fresh install with no lockfile if the problem persists.
npm verbose reify unrecognized node in tree /home/jenkins/workspace/xxx/yyyy/zzzz/node_modules/my-private-package
I just upgraded from npm 11.2 to 11.4.1 this morning and I started seeing this issue too. I was trying to "npm update" a git URL to my local gitlab instance and it complains about the lock file being corrupt and removes my dependency from package-lock.json and from node_modules. I downgraded to 11.2 and the issue was resolved. For the record, I tried 11.4 and 11.3 too, but they both failed similarly.
Here is my working package-lock.json file with npm 11.2.0.
All I did was upgrade to 11.4.1 and then do a "npm update aq-mapper" which is one of my git URL dependencies.
I did try to start from scratch with no package-lock and removing my git URL dependencies and trying to re-add them to package.json, but nothing worked.
My goal here is to try to reproduce the issue. So If i have the exact setup or any minimum reproduction case that you can reproduce this behaviour at your will then please provide those setup/steps so I can replicate the same at my end to better understand what's happening at your end as for me it's working as expected so far.
I am not sure it is going to be that simple, since it doesn't seem to be project related, rather it appears to be system config related. Here is a session I just performed which shows the issue:
$ npm --version
11.4.1
$ mkdir npm-error
$ cd npm-error/
$ npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.
See `npm help init` for definitive documentation on these fields
and exactly what they do.
Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.
Press ^C at any time to quit.
package name: (npm-error)
version: (1.0.0)
description: Try to recreate npm git url error
entry point: (index.js)
test command:
git repository:
keywords:
author:
license: (ISC)
type: (commonjs) module
About to write to /home/rickhall/Projects/npm-error/package.json:
{
"name": "npm-error",
"version": "1.0.0",
"description": "Try to recreate npm git url error",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"type": "module"
}
Is this OK? (yes) yes
$ npm install git@gitlab.glastender.com:glastender/aq-mapper.git
npm warn reify invalid or damaged lockfile detected
npm warn reify please re-try this operation once it completes
npm warn reify so that the damage can be corrected, or perform
npm warn reify a fresh install with no lockfile if the problem persists.
npm warn reify invalid or damaged lockfile detected
npm warn reify please re-try this operation once it completes
npm warn reify so that the damage can be corrected, or perform
npm warn reify a fresh install with no lockfile if the problem persists.
added 72 packages, and audited 73 packages in 17s
found 0 vulnerabilities
$
$ npm install git@gitlab.glastender.com:glastender/aq-mapper.git
npm warn reify invalid or damaged lockfile detected
npm warn reify please re-try this operation once it completes
npm warn reify so that the damage can be corrected, or perform
npm warn reify a fresh install with no lockfile if the problem persists.
npm warn reify invalid or damaged lockfile detected
npm warn reify please re-try this operation once it completes
npm warn reify so that the damage can be corrected, or perform
npm warn reify a fresh install with no lockfile if the problem persists.
Yeah this can't be reproduced at the moment since that GitLab server is private
I tried testing installing from github using an https URL and that seemed to work. I tried using https URLs to install from some of the publicly available gitlab instances, but that just fails in general with a different issue (invalid tar or something).
I don't have git URL access to any other public gitlab instance to test, so I'm not sure how to reproduce.
Well, if nothing else, it is something that changed between 11.2.0 and 11.3.0, so is there anything in there that might impact this area? I'm willing to do a little bit of leg work, if we can narrow down a process for determining where the error was introduced.
Activity
alexsch01 commentedon May 27, 2025
do you have a way for us to reproduce the issue?
does this issue happen on npm 11.4.0?
milaninfy commentedon May 28, 2025
@animechitransh
I have tried to reproduce the issue but I am not able to get the error that you mentioned. Here are the output from my run.
npm install
inspecting node_modules to check if it installed the package
package-lock.json
rickhall commentedon May 29, 2025
I just upgraded from npm 11.2 to 11.4.1 this morning and I started seeing this issue too. I was trying to "npm update" a git URL to my local gitlab instance and it complains about the lock file being corrupt and removes my dependency from package-lock.json and from node_modules. I downgraded to 11.2 and the issue was resolved. For the record, I tried 11.4 and 11.3 too, but they both failed similarly.
I am on Fedora 42 and node 20.17.0.
alexsch01 commentedon May 29, 2025
@rickhall if possible can you share your package-lock.json?
rickhall commentedon May 30, 2025
Here is my working package-lock.json file with npm 11.2.0.
All I did was upgrade to 11.4.1 and then do a "npm update aq-mapper" which is one of my git URL dependencies.
I did try to start from scratch with no package-lock and removing my git URL dependencies and trying to re-add them to package.json, but nothing worked.
package-lock.json
milaninfy commentedon May 30, 2025
@rickhall will you be able to provide full run logs/output, steps, package.json, configs etc ?
rickhall commentedon May 30, 2025
@milaninfy Probably. Just tell me what exactly you want me to do.
milaninfy commentedon May 30, 2025
My goal here is to try to reproduce the issue. So If i have the exact setup or any minimum reproduction case that you can reproduce this behaviour at your will then please provide those setup/steps so I can replicate the same at my end to better understand what's happening at your end as for me it's working as expected so far.
rickhall commentedon May 30, 2025
I am not sure it is going to be that simple, since it doesn't seem to be project related, rather it appears to be system config related. Here is a session I just performed which shows the issue:
animechitransh commentedon May 30, 2025
@milaninfy Apologies, I was out sick. I saw the issue while working in work(organization) codebase with
I'll try to reproduce the repo with publicly available package/ code else will try to share sanitized logs
cc: @rickhall
alexsch01 commentedon Jun 2, 2025
Yeah this can't be reproduced at the moment since that GitLab server is private
rickhall commentedon Jun 2, 2025
I tried testing installing from github using an https URL and that seemed to work. I tried using https URLs to install from some of the publicly available gitlab instances, but that just fails in general with a different issue (invalid tar or something).
I don't have git URL access to any other public gitlab instance to test, so I'm not sure how to reproduce.
lukomuko commentedon Jun 4, 2025
Same error for me. (also in 11.3)
With a downgrade to 11.2 it works for me again
alexsch01 commentedon Jun 6, 2025
@lukomuko do you have a simple way to reproduce the issue?
rickhall commentedon Jun 9, 2025
Well, if nothing else, it is something that changed between 11.2.0 and 11.3.0, so is there anything in there that might impact this area? I'm willing to do a little bit of leg work, if we can narrow down a process for determining where the error was introduced.
lukomuko commentedon Jun 10, 2025
I just import another project in my package.json like this.
fix(arborist): use hosted-git-info to correctly parse resolved git ur…