Eug*_*kov 31 bitbucket node.js npm
我正在尝试安装最近从github移动到bitbucket的私有包.
npm install git@bitbucket.org:owner/repo.git
Run Code Online (Sandbox Code Playgroud)
结束了
npm http GET https://registry.npmjs.org/git
Run Code Online (Sandbox Code Playgroud)
(注意网址中的包)有这个错误:
错误的ERR!notarget未找到兼容的版本:git@'bitbucket.org:flyvictor/fortune-secruity.git'
(注意'事后@)
我试图逃避@,用引号包装repo名称,但总是得到相同的结果.
对于github,我们使用格式化的网址git://github.com/owner/repo#v.v.v,这样可以正常工作!但是如果我对bitbucket npm使用相同的语法就会挂起什么都不做.
任何的想法?
ps键,访问权限,所以一个是正确的.我可以为这些repos做贡献,用git克隆它们,但不能用npm install克隆它们.安装得好的Github软件包也是私有的.
use*_*694 68
npm install git+ssh://git@bitbucket.org/{user}/{repository}.git
Run Code Online (Sandbox Code Playgroud)
gzt*_*mas 14
npm install bitbucket:<bitbucketname>/<bitbucketrepo>
Run Code Online (Sandbox Code Playgroud)
声明:正如 Eric Uldall 所说:这种方法很简单,但缺乏安全性。您现在已将纯文本密码提交到您的存储库。这就是我最近的锻炼方式,但不推荐。
直接从NPM文件的install命令:
$ npm install bitbucket:<bitbucketname>/<bitbucketrepo>[#<commit-ish>]
Run Code Online (Sandbox Code Playgroud)
例子:
$ npm install bitbucket:mybitbucketuser/myproject
Run Code Online (Sandbox Code Playgroud)
该纱线文件为add今天的2019年2月28日没有对git仓库的支持。
上面的示例不适用于我的私有存储库,因为您需要生成一个令牌才能使用它。那个怎么样?
登录您的 Bitbucket 帐户并在用户设置下添加应用密码:
然后,您可以将依赖项添加到您的package.jsonas:
"dependencies": {
"module": "git+https://<username>:<app-password>@bitbucket.org/<owner>/<repo>.git"
}
Run Code Online (Sandbox Code Playgroud)
或在您的终端类型上:
npm install git+https://<username>:<app-password>@bitbucket.org/<repo-owner>/<repo>.git
Run Code Online (Sandbox Code Playgroud)
不要忘记替换:
| 归档时间: |
|
| 查看次数: |
28139 次 |
| 最近记录: |