简体   繁体   English

NPM安装:package.json中的Git URL依赖性错误

[英]NPM install : Git URL dependency error in package.json

I want to set a dependency that is a Git URL of a private package in package.json I write : 我想设置一个依赖项,它是package.json中私有包的Git URL我写道:

"dependencies" : { 
    "mymodule" : "git://git@git.myrepo.com:/myproject#mybranch"
}

When running npm install I get this error : 运行npm install此错误:

git clone git://git@git.myrepo.com:/myproject.git Cloning into bare repository '/hom
/Ostro/.npm/_git-remotes/git-git-myrepo-com-myproject-git-4d838f3d'...
npm ERR! git clone git://git.myrepo.com:/myproject.git
npm ERR! git clone git://git.myrepo.com:/myproject.git fatal: Unable to look up
git.myrepo.com (port ) (Servname() not supported for ai_socktype)
npm ERR! Error: git "clone" "--mirror" "git://git.myrepo.com:/myproject.git" "/hom
/Ostro/.npm/_git-remotes/git-git-myrepo-com-myproject-git-4d838f3d" failed with 128
npm ERR! at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/exec.js:56:20)
npm ERR! at ChildProcess.EventEmitter.emit (events.js:99:17)
npm ERR! at maybeClose (child_process.js:638:16)
npm ERR! at Socket.ChildProcess.spawn.stdin (child_process.js:815:11)
npm ERR! at Socket.EventEmitter.emit (events.js:96:17)
npm ERR! at Socket._destroy.destroyed (net.js:358:10)
npm ERR! at process.startup.processNextTick.process._tickCallback (node.js:245:9)

But it looks like npm call git clone --mirror git://git.myrepo.com ...etc does it not suppose to call git clone --mirror git.myrepo.com ...etc instead ? 但它看起来像npm调用git clone --mirror git://git.myrepo.com ...etc不是不应该调用git clone --mirror git.myrepo.com ...etc吗?

Do someone already face that ? 有人已经面对了吗? or have any clue ? 或者有任何线索?

The valid forms are below. 有效表格如下。 If you are using username@, you need to specify either ssh or https. 如果您使用的是用户名@,则需要指定ssh或https。 Also, I am not sure the :/ is valid if you are not using an account. 此外,我不确定:/如果您没有使用帐户,则有效。

git://github.com/user/project.git#commit-ish
git+ssh://user@hostname:project.git#commit-ish
git+ssh://user@hostname/project.git#commit-ish
git+http://user@hostname/project/blah.git#commit-ish
git+https://user@hostname/project/blah.git#commit-ish

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 npm安装没有package.json的git存储库 - npm install git repository without package.json 使用https协议在package.json中使用私有git repo进行npm安装时出现权限错误 - Permission error to use private git repo in package.json for npm install using https protocol 如何在不同的相应本地分支package.json中将单独的git分支用作npm包依赖关系? - How to use separate git branch as npm package dependency in different corresponding local branch package.json? npm install没有读取package.json - npm install not reading package.json Git存储库到package.json中的依赖项 - Git repository to a dependency in package.json NPM 安装/更新:无需使用 Git 存储库更改 package.json 即可获取最新版本 - NPM install/update: Getting the latest version without having to alter package.json with Git repository npm 错误。 尝试安装 package.json 时 git dep 准备失败 - npm ERR! git dep preparation failed when trying to install package.json 如何在npm package.json git项目中更新Git Hash? - How To Update Git Hash in npm package.json git project? 如何在我的package.json中添加非npm依赖项? - How to add a non-npm dependency to my package.json? npm 使用 git 信息而不是 package.json 中的版本发布 - npm publish with git information instead of version from package.json
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM