我分叉了npm模块之一,现在它是git repo。
所以我的package.json:
"dependencies": {
"some-module": "git+https://github.com/my-name/some-module.git",
}
派生的回购通过获取上游和合并来同步。但是,当我尝试更新其他npm模块时,会出现错误:
npm ERR! git Appears to be a git repo or submodule.
npm ERR! git /Users/.../node_modules/some-module
npm ERR! git Refusing to remove it. Update manually,
npm ERR! git or move it out of the way first.
npm ERR! System Darwin 13.4.0
npm ERR! command "node" "/usr/local/bin/npm" "update"
npm ERR! cwd /Users/...
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! path /Users/.../node_modules/some-module
npm ERR! code EISGIT
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/.../npm-debug.log
npm ERR! not ok code 0
有什么方法可以在更新时忽略git repo吗?还是跳过此错误?
npm检查所有目录中是否存在.git
目录,EISGIT
如果存在则抛出错误,因此无法忽略或跳过它。
但是代码不会检查它是否是链接:
mod.parent && !mod.isLink && [checkGit, mod.realpath],
因此,我可以通过将模块符号链接到node_modules中来使其工作。
$ ln -s ../some-module node_modules
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句