NPM安装:package.json中的Git URL相关性错误
我想在package.json中设置一个依赖,它是一个私有包的Git URL我写:
"dependencies" : { "mymodule" : "git://git@git.myrepo.com:/myproject#mybranch" }
当运行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)
但它看起来像npm调用git clone --mirror git://git.myrepo.com ...etc
它不会打电话给git clone --mirror git.myrepo.com ...etc
呢?
有人已经面对这个? 或有任何线索?
有效的表格如下。 如果您使用的是用户名@,则需要指定ssh或https。 另外,如果您没有使用帐户,我不确定:/有效。
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
- npm通知创build了一个lockfile作为package-lock.json。 你应该提交这个文件
- 有没有办法将package.json文件中的依赖项安装到不同的目录中?
- 让npm从Git仓库获取最新的软件包
- npm脚本忽略错误
- github ssh公共密钥没有find与node.js child_process.spawn()在Windows上,但在child_process.exec()可见
- npm WARN package.json Stock@0.0.1没有版本库字段
- 修改示例Hello World Node.js代码在Google Compute Engine中不起作用
- GitLab + GitLab CI +通过NPM从属SSH项目
- 如何从webhook运行Gulp