npm install上的致命错误对象错误

我正在做一个npm安装,并得到以下错误:

 npm ERR! git rev-list -n1 8d27c06c2903538cd740a80edeae548922d057a5: fatal: bad object 8d27c06c2903538cd740a80edeae548922d057a5 npm ERR! git rev-list -n1 8d27c06c2903538cd740a80edeae548922d057a5: npm ERR! git rev-list -n1 e92ca1c26c338ab641e70089cf8f57c140f39207: fatal: bad object e92ca1c26c338ab641e70089cf8f57c140f39207 npm ERR! git rev-list -n1 e92ca1c26c338ab641e70089cf8f57c140f39207: npm ERR! git rev-list -n1 d90b1e34c799bf61cd1aafdc33db0a554fa9e617: fatal: bad object d90b1e34c799bf61cd1aafdc33db0a554fa9e617 npm ERR! git rev-list -n1 d90b1e34c799bf61cd1aafdc33db0a554fa9e617: npm ERR! git rev-list -n1 f7f5bd678b80ec90c8d5c38c106f27466701fb2b: fatal: bad object f7f5bd678b80ec90c8d5c38c106f27466701fb2b npm ERR! git rev-list -n1 f7f5bd678b80ec90c8d5c38c106f27466701fb2b: npm ERR! git rev-list -n1 b7125954deccc8d802444effc02253b8729964a1: fatal: bad object b7125954deccc8d802444effc02253b8729964a1 npm ERR! git rev-list -n1 b7125954deccc8d802444effc02253b8729964a1: npm ERR! git rev-list -n1 db701e170ba4cb11af3bac09411296cdb0e8215a: fatal: bad object db701e170ba4cb11af3bac09411296cdb0e8215a npm ERR! git rev-list -n1 db701e170ba4cb11af3bac09411296cdb0e8215a: npm ERR! git rev-list -n1 997ea0caad31d523b95cf64d03e28608561a36a6: fatal: bad object 997ea0caad31d523b95cf64d03e28608561a36a6 npm ERR! git rev-list -n1 997ea0caad31d523b95cf64d03e28608561a36a6: npm ERR! git rev-list -n1 ea5466317ab75de6f46b0b39bae7a29c2aa18d68: fatal: bad object ea5466317ab75de6f46b0b39bae7a29c2aa18d68 npm ERR! git rev-list -n1 ea5466317ab75de6f46b0b39bae7a29c2aa18d68: npm ERR! git rev-list -n1 2bebf3223b7b9ab00a18e294a52bcfffbbe066b7: fatal: bad object 2bebf3223b7b9ab00a18e294a52bcfffbbe066b7 npm ERR! git rev-list -n1 2bebf3223b7b9ab00a18e294a52bcfffbbe066b7: npm ERR! git rev-list -n1 2dac046de6abc4c4f16ac25133c38cfe49a7368d: fatal: bad object 2dac046de6abc4c4f16ac25133c38cfe49a7368d npm ERR! git rev-list -n1 2dac046de6abc4c4f16ac25133c38cfe49a7368d: npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" npm ERR! node v5.6.0 npm ERR! npm v3.6.0 npm ERR! code 128 npm ERR! Command failed: git -c core.longpaths=true rev-list -n1 8d27c06c2903538cd740a80edeae548922d057a5 npm ERR! fatal: bad object 8d27c06c2903538cd740a80edeae548922d057a5 npm ERR! npm ERR! npm ERR! If you need help, you may report this error at: npm ERR! <https://github.com/npm/npm/issues> 

我googled的问题增加了longPath真正的gitconfiguration文件,它看起来像这样

 [credential] helper = manager [remote "origin"] url = git@github.com:xxxx/xxxx-xx [core] longpaths = true 

我的Package.json是

 { "name": "xxxx-xx", "version": "0.0.1", "main": "app.js", "browserify": { "transform": [ "html2js-browserify" ] }, "scripts": { "postinstall": "gulp hook" }, "dependencies": { "angular": "1.3.15", "angular-animate": "1.3.15", "angular-aria": "1.3.15", "angular-cookies": "1.3.15", "angular-dynamic-locale": "git+ssh://github.com/xxxx/angular-dynamic-locale", "angular-file-upload": "git+ssh://git@github.com/xxxx/angular-file-upload.git#v1.1.5", "angular-growl-v2": "git+ssh://git@github.com/xxxxx/angular-growl-2.git#0.7.4", "angular-i18n": "1.3.15", "angular-messages": "1.3.15", "angular-sanitize": "1.3.15", "angular-touch": "1.3.15", "angular-translate": "2.7.0", "angular-ui-bootstrap": "0.14.3", "angular-ui-router": "0.2.15", "backstopjs": "^1.2.1", "d3": "3.5.6", "d3.chart": "git+ssh://git@github.com/xxx/xxx-d3.chart.git", "gulp": "^3.9.0", "html-minifier": "^3.0.2", "html2js-browserify": "0.0.2", "intro.js": "git+ssh://git@github.com/xxxx/intro.js.git#v1.0.0", "lodash": "3.10.1", "moment": "^2.11.1", "moment-timezone": "^0.5.0", "ng-storage": "0.3.1", "ng-file-upload": "12.2.12", "omniture": "git+ssh://git@github.com/xxxx/xxxx-omniture.git", "ui-select": "git+ssh://git@github.com/xxxx/xxxx-ui-select.git" }, "optionalDependencies": [ "utf-8-validate", "bufferutil", "fsevents" ] } 

我的研究发现,

  • 由于窗口不支持path太长的文件名,文件中的path太长,可能会发生这种错误。 所以正如我刚才提到的,我在git config File中添加了一个很长的path

  • 如果提交已损坏或git未指向正确的提交,则也会发生此错误。 为此,我将#master添加到所有存储库的末尾,然后重新运行npm install 。 但这些都没有为我工作。

我在这里错过了什么。 提前致谢。

       

网上收集的解决方案 "npm install上的致命错误对象错误"

我也在为此苦苦挣扎。 我尝试了所有我能想到的,包括更新节点和npm,尝试在我的gitconfig文件中设置longpath = true(它已经设置)。

我终于能够通过更新git来解决这个问题。 我在2.8.2,我更新到2.13.0,一切都开始工作了。 我的猜测是有一个错误,在后来的版本中修复。