【发布时间】:2018-10-14 20:20:37
【问题描述】:
我有一个库作为公共存储库推送到 bitbucket。我希望它的链接在 package.json 依赖对象中使用。我尝试了各种 https 格式,但没有一种是有效的。
"library_name": "https://username@bitbucket.org/repo_name.git"
"library_name": bitbucket://bitbucket.com/username/repo_name.git
"library_name": "bitbucket@bitbucket.com:username/repo_name.git#master
或者我可以在 bower.json 中添加它?我不想像 npm install repo_url 那样直接使用它
我得到的错误类似于
ECMDERR Failed to execute "git ls-remote --tags --heads https://username@bitbucket.org/dv.keystone.git", exit code of #128 remote: Not Found fatal: unable to access 'https://username@bitbucket.org/reponame.git/': GnuTLS recv error (-110): The TLS connection was non-properly terminated.
remote: Not Found
fatal: unable to access 'https://username@bitbucket.org/repo_name.git/': GnuTLS recv error (-110): The TLS connection was non-properly terminated.
更新:
"lib_name": "https://username@bitbucket.org/team_name/repo_name.git"
它在 bower.json 中工作,但我需要在 package.json 中工作。如果我在 package.json 中使用它,它会给出这个错误
npm ERR! addLocal Could not install /tmp/npm-16628-b0121d64/git-cache-cbc9eb1e/7c4c6a5fb3e77723f3866c99fdf0825ba7cc0c5c
npm ERR! Linux 4.13.0-39-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v6.12.3
npm ERR! npm v3.10.10
npm ERR! code EISDIR
npm ERR! errno -21
npm ERR! syscall read
npm ERR! eisdir EISDIR: illegal operation on a directory, read
npm ERR! eisdir This is most likely not a problem with npm itself
npm ERR! eisdir and is related to npm not being able to find a package.json in
npm ERR! eisdir a package you are trying to install.
【问题讨论】:
-
澄清一下 - 你在哪里有
username@bitbucket.org,你是在使用username作为这个问题的占位符,还是你实际添加到 JSON 文件中的内容? -
这只是这个问题的占位符。
标签: npm bitbucket bower node-modules package.json