I am trying to install project dependencies using npm i on a Windows computer. However, I come to this error:
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: x-oauth-basic@github.com /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
I did some research and found that these problems are related to windows that do not support files and directories longer than 260 characters. The workaround I got is to use this command to resolve the longpath file name:
git config core.longpaths true
But this does not seem to work. Can anyone suggest a workaround and why is this happening?
Node and NPM versions: Node: v6.2.0 NPM: 3.8.9
Please let me know if there are details that I need to provide?
source share