【发布时间】:2020-09-28 20:15:50
【问题描述】:
在最后一天,我正在努力将 git 存储库用作组件。
我尝试了很多方法,但当我输入npm i时都没有工作
这是我尝试过的一些方法:
npm install from Git in a specific version,
How to use private Github repo as npm dependency
Git repository to a dependency in package.json
Import component from a different repo
我在 git hub 中创建了 2 个代表:
main project => 应该使用组件
chocolate component => 那是我的组件
每次我把它放在我的 package.json(主项目 repo)中,我都会得到那个错误:
"dependencies": {
"test-component": "IgorEstevao/test-component#master", # try 1
"test-component": "git://github.com/IgorEstevao/test-component.git#0.0.1", # try 2
"test-component": "git://github.com/IgorEstevao/test-component.git", # try 3...
}
npm ERR! premature close
我如何在主项目中使用巧克力组件?
请记住,未来的展位存储库将是私有的,所以我想我需要使用 github api 密钥来访问?
【问题讨论】:
-
那是你真正的“依赖”JSON吗?三个具有相同键和尾随逗号的条目?