Skip to content

[BUG] Error installing private GitLab repositories in v7 #1963

Closed
@rsispal

Description

@rsispal

Current Behavior:

When running npm install on projects that utilise private GitLab repositories as dependencies (authenticated via SSH key on my machine), I receive the following error:

npm ERR! Wrong spec type (git) for RemoteFetcher. Supported types: remote
npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/-/.npm/_logs/2020-10-14T23_36_32_883Z-debug.log

And here is the error excerpt from the log file:

2601 verbose stack TypeError: Wrong spec type (git) for RemoteFetcher. Supported types: remote
2601 verbose stack     at RemoteFetcher.[_assertType] (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/fetcher.js:219:13)
2601 verbose stack     at new FetcherBase (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/fetcher.js:59:22)
2601 verbose stack     at new RemoteFetcher (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/remote.js:14:5)
2601 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/pacote/lib/git.js:208:16
2601 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/cacache/lib/util/disposer.js:26:43
2602 verbose cwd /Users/-/-
2603 verbose Darwin 19.6.0
2604 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "i"
2605 verbose node v13.9.0
2606 verbose npm  v7.0.0
2607 error Wrong spec type (git) for RemoteFetcher. Supported types: remote
2608 verbose exit 1

As it stands, I am unable to utilise NPM v7 with private GitLab repositories. I dont think I've missed anything as there are no errors when using npm 6.14.8.

Expected Behavior:

Each of these projects which use GitLab private repos (authenticated on my machine via SSH key, not HTTPS) as dependencies used to install and the project would run as expected.

Steps To Reproduce:

  1. Create a private repository on GitLab
  2. Ensure your machine can access/clone private repositories from GitLab via SSH
  3. Initialise an NPM project
  4. Install your dependency via npm i --save "git+ssh://git@gitlab.com:path/to/repo/myreponame.git#master"
  5. See the above error

Environment:

  • OS: MacOS 10.15.6 Catalina
  • Node: 13.9.0
  • npm: 7.0.0

Metadata

Metadata

Assignees

Labels

Bugthing that needs fixingRelease 7.xwork is associated with a specific npm 7 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions