Node.js 将semver范围作为npm依赖项的Git SSH URL

Node.js 将semver范围作为npm依赖项的Git SSH URL,node.js,git,npm,gitlab,Node.js,Git,Npm,Gitlab,在遵循以下原则的同时: 但我收到了以下错误: npm ERR! code 1 npm ERR! Command failed: /usr/bin/git checkout semver:^1.2.3 npm ERR! error: pathspec 'semver:^1.2.3' did not match any file(s) known to git. npm ERR! npm ERR! A complete log of this run can be found in: npm E

在遵循以下原则的同时:

但我收到了以下错误:

npm ERR! code 1 npm ERR! Command failed: /usr/bin/git checkout semver:^1.2.3 npm ERR! error: pathspec 'semver:^1.2.3' did not match any file(s) known to git. npm ERR! npm ERR! A complete log of this run can be found in: npm ERR! /path/to/DATE-debug.log npm错误!代码1 npm错误!命令失败:/usr/bin/git签出版本:^1.2.3 npm错误!错误:pathspec“semver:^1.2.3”与git已知的任何文件都不匹配。 npm错误! npm错误!此运行的完整日志可在以下位置找到: npm错误/path/to/DATE-debug.log 即使指定分支或特定标记也可以正常工作:

git+ssh://git@gitlab.example.com:group/project.git#branch_1_2 git+ssh://git@gitlab.example.com:group/project.git#1.2.3 吉特+ssh://git@gitlab.example.com:group/project.git#branch_1_2 吉特+ssh://git@gitlab.example.com:group/project.git#1.2.3 版本信息

  • 操作系统:ubuntu 18.04
  • 节点-v:v10.0.0
  • npm-v:v5.6.0

  • 这是一个bug

    在URL的主机路径部分之间替换冒号:

    git+ssh://git@gitlab.example.com/group/project.git#semver:^1.2.3 don't use a colon here ^ 吉特+ssh://git@gitlab.example.com/group/project.git#semver:^1.2.3 这里不要用冒号^ 信息

    您应该能够根据以下条件使用冒号或斜杠:

    ://[:]@[:][:][/][#|##塞姆弗:]
    
    但是GitLab[un]为您提供了一个冒号链接,可以进行复制/粘贴

    如本文所述:

    看起来这个早在5.1.x就坏了。当使用
    npm i-g npm@~5.0.0

    正如在参考资料中提到的,这个bug现在已经修复,但从v5.6.0开始还不是npm的一部分

    git+ssh://git@gitlab.example.com:group/project.git#branch_1_2 git+ssh://git@gitlab.example.com:group/project.git#1.2.3 git+ssh://git@gitlab.example.com/group/project.git#semver:^1.2.3 don't use a colon here ^