如何列出一个私人Github上回购为"dependency"中package.json?我尝试了npm的Github URL语法ryanve/example,但是npm install在package文件夹中进行了私有依赖项的"无法安装"错误.是否有一个特殊的语法(或其他机制)依赖私人回购?
我使用浏览器中的Github UI创建了私有repo examplesite/myprivaterepo.
然后我去了我的go目录(在桌面上)并克隆了它:
$ cd $GOPATH
$ go get github.com/examplesite/myprivaterepo
Run Code Online (Sandbox Code Playgroud)
到现在为止还挺好.创建文件scheduler.go,添加到repo,然后推送.
$ vim scheduler.go
$ git add scheduler.go
$ git commit
$ git push
Run Code Online (Sandbox Code Playgroud)
Everythng没关系.但当我去一台干净的笔记本电脑并试图克隆回购时,我收到一个错误:
# Now on laptop, which doesn't yet know about the repo
$ cd $GOPATH
$ go get github.com/examplesite/myprivaterepo
# At this point it should ask for my user ID and password ,right? But it doesn't.
# Instead, this error occurs:
cd .; git clone https://github.com/examplesite/myprivaterepo /Users/tom/go/src/github.com/examplesite/myprivaterepo
Cloning into '/Users/tom/go/src/github.com/examplesite/myprivaterepo'...
fatal: could not read Username …Run Code Online (Sandbox Code Playgroud)