Skip to content

npm install from private git repository #1688

@rufreakde

Description

@rufreakde

Hi all,

I try to install a git based npm package which is in a subdirectory. So far without any sucess! Any idea what the issue might be?

npm --version
# 11.4.2
node --version
# v24.3.0

# install command
npm install "git+https://$GH_USERNAME:$GH_PASSWORD@github.private/my/repository-library.git:#branch:sub/path/to/test-lib-folder"

Is the command wrong? Or maybe the content of the subpath has to be in a specific format? What would need to be changed to get it to work I was not able to find a suitable guide for that.

# library package.json
{
  "name": "@test/lib",
  "version": "0.0.1",
  "type": "commonjs",
  "main": "./src/index.js",
  "types": "./src/index.d.ts",
  "dependencies": {
    "tslib": "^2.3.0"
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions