Error installing Node dependency using URL

I have set up Parse Server on my Mac. I am trying to add a forked repo but npm install fails with below error.

> fatal: not a git repository (or any of the parent directories): .git
> npm ERR! /bin/sh: hg: command not found
> npm ERR! node:child_process:965
> npm ERR!     throw err;
> npm ERR!     ^
> npm ERR!
> npm ERR! Error: Command failed: git rev-parse --abbrev-ref HEAD || hg branch
> npm ERR! fatal: not a git repository (or any of the parent directories): .git

Things I tried:

  1. If I replace URL with repo’s version number then no error.
  2. Using original repo’s URL also causes same error.
  3. Tried adding β€œ#release” in URL also.
  4. Installed Mercurial
  5. Repo is public but tried with GitHub token in URL also

package.json :

{
    "name": "app",
    "version": "1.4.0",
    "description": "Local parse server: ",
    "main": "index.js",
    "repository": {
        "type": "git",
        "url": ""
    },
    "license": "MIT",
    "dependencies": {
        "cors": "*",
        "dotenv": "^8.2.0",
        "express": "4.18.2",
        "parse-server": "7.3.0",
        "underscore": "*",
        "parse": "5.0.0",
        "cryptoutils": "*",
        "parse-server-api-mail-adapter": "git+https://github.com/ashish-naik/parse-server-api-mail-adapter.git",
        "mailgun.js": "git+https://github.com/mailgun/mailgun.js.git",
        "form-data": "^4.0.0",
        "node-schedule": "latest",
        "parse-dashboard": "6.0.0",
        "path": "*",
        "socket.io-client": "^3.0.3",
        "aws-sdk": "*",
        "@aws-sdk/credential-providers": "*",
        "@aws-sdk/client-ses": "*",
        "google-auth-library": "9.6.2",
        "jsonwebtoken": "*",
        "node-fetch": "2.7.0",
        "zeptomail":"6.0.0"
    },
    "scripts": {
        "start": "node index.js"
    },
    "engines": {
        "node": "20.12.2",
        "npm": "10.5.0"
    }
}

Looks more like a git issue at first glance. Maybe try to the delete the hidden .git directory at the root, but beware that that will delete the repository info.