Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MS Windows 10: Error: Command failed: git -c core.longpaths=true config --get remote.origin.url

I'm trying to install my project dependencies using npm i on Windows machine. However I'm landing 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:[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

I did some research and found that this issues is related to the windows not supporting files and directories longer than 260 characters. The workaround I got was to use this command to allow longpath filename:

git config core.longpaths true

But this doesn't seem to be working. Can anyone please suggest a workaround and why this is happening?

Node and NPM versions: Node: v6.2.0 NPM: 3.8.9

Please let me know if there's more details that I need to provide?

like image 914
Abhishek Avatar asked Nov 09 '22 04:11

Abhishek


1 Answers

You have to update your npm. I had this problem before updating to npm 5.

like image 62
Meysam Izadmehr Avatar answered Nov 14 '22 21:11

Meysam Izadmehr