![](/img/trans.png)
[英]Private github repo as dependency is extraneous on npm install
[英]Can't npm install after including public github repo as dependency
我有一个仅包含一系列.md markdown文件的公共node_modules
,我想在每次npm install
时将其放入我的node_modules
,以便可以在我的主要网站中使用该markdown内容。
我(认为)我已经根据这里的npm文档更新了package.json
: https ://docs.npmjs.com/files/package.json#github-urls ...
我的package.json
现在具有:
"dependencies": {
"repoName": "git://github.com/{orgName}/{repoName}.git"
}
我也尝试了其他速记方法,例如: "repo-name": "organization/repo-name"
当我尝试运行npm install
,出现以下错误:
npm ERR! path /Users/<user>/.npm/_cacache/tmp/git-clone-6be72c5b/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/Users/<user>/.npm/_cacache/tmp/git-clone-6be72c5b/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/<user>/.npm/_logs/2018-05-23T04_39_57_402Z-debug.log
日志文件提供的唯一附加信息是...
18 verbose Darwin 17.4.0
19 verbose argv "/usr/local/Cellar/node/7.0.0/bin/node" "/usr/local/bin/npm" "install"
20 verbose node v7.0.0
21 verbose npm v5.6.0
有人知道我在做什么错吗? 当我没有这种依赖性时,使用npm的一切都很糟糕。
尝试一些类似的事情,用您的东西填充所有内容:)
"dependencies": {
"GitRepo": "git+https://<token-from-github>:x-oauth-basic@github.com/<user>/<GitRepo>.git"
}
希望对您有所帮助:)自从x-oauth公开以来,您应该可以忽略它
@Whymarrh指出,我需要在依赖项存储库上初始化npm。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.