5
我試圖在Windows機器上使用npm i安裝我的項目依賴項。但是我登陸這個錯誤:MS Windows 10:錯誤:命令失敗:git -c core.longpaths = true config --get remote.origin.url
npm WARN addRemoteGit Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit at ChildProcess.exithandler (child_process.js:202:12)
npm WARN addRemoteGit at emitTwo (events.js:106:13)
npm WARN addRemoteGit at ChildProcess.emit (events.js:191:7)
npm WARN addRemoteGit at maybeClose (internal/child_process.js:850:16)
npm WARN addRemoteGit at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
npm WARN addRemoteGit git+https://5345345erg345eg34eg:[email protected]/test/test.git resetting remote C:\Users\Administrator\AppData\Roaming\npm-cache\_git-remotes\git-https-test-89f19adf because of error: { Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i"
npm ERR! node v6.2.0
npm ERR! npm v3.8.9
npm ERR! code 128
npm ERR! fatal: bad object 1cf23bc52c0a3b1b5dde89949ff9f820522e0367
npm ERR! fatal: remote did not send all necessary objects
我做了一些研究,發現這個問題是有關不支持的文件和目錄超過260個字符的窗口。我得到的解決方法是使用此命令允許長路徑文件名:
git config core.longpaths true
但是,這似乎並沒有工作。任何人都可以請建議一種解決方法,爲什麼會發生這種情況?
節點和NPM版本: 節點: V6.2.0 NPM: 3.8.9
請讓我知道,如果有更多的細節,我需要提供哪些資料?
您是否正常工作? –
@MahinKhan找不到任何解決方案。現在已經切換到Mac。 –