isaacs/npm — Issue #1910: No git for Windows
Author: chowey
Created: 2011-12-21 01:53:37+00:00
State: open

If I try to install a repo from github, like it says in the manual, it doesn't work.

npm install git+https://github.com/visionmedia/hamljs.git

gives the following debug log:

info it worked if it ends with ok
verbose cli [ 'node',
verbose cli 'C:\\Users\\cam\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
verbose cli 'install',
verbose cli 'git+https://github.com/visionmedia/hamljs.git',
verbose cli '--verbose' ]
info using npm@1.1.0-beta-7
info using node@v0.6.6
verbose config file C:\Users\cam\.npmrc
verbose config file C:\Program Files\nodejs\etc\npmrc
verbose config file C:\Users\cam\AppData\Roaming\npm\node_modules\npm\npmrc
verbose mkdir done: C:\Users\cam\AppData\Roaming\npm 755
verbose mkdir done: c:\node 755
verbose caching c:\node\node_modules\hamljs\package.json
verbose loadDefaults hamljs@0.5.2
verbose into c:\node [ 'git+https://github.com/visionmedia/hamljs.git' ]
verbose cache add git+https://github.com/visionmedia/hamljs.git
verbose cache add [ 'git+https://github.com/visionmedia/hamljs.git', null ]
silly cache add: name, spec, args [ undefined,
silly cache add: name, spec, args 'git+https://github.com/visionmedia/hamljs.git',
silly cache add: name, spec, args [ 'git+https://github.com/visionmedia/hamljs.git', null ] ]
verbose parsed url { protocol: 'githttps:',
verbose parsed url slashes: true,
verbose parsed url host: 'github.com',
verbose parsed url hostname: 'github.com',
verbose parsed url href: 'githttps://github.com/visionmedia/hamljs.git',
verbose parsed url pathname: '/visionmedia/hamljs.git',
verbose parsed url path: '/visionmedia/hamljs.git' }
verbose addRemoteGit [ 'https://github.com/visionmedia/hamljs.git', 'master' ]
verbose mkdir (expected) error ENOENT, no such file or directory 'C:\Users\cam\AppData\Local\Temp\npm-1324432026246'
verbose mkdir done: C:\Users\cam\AppData\Local\Temp\npm-1324432026246 755
silly exec git "clone" "https://github.com/visionmedia/hamljs.git" "C:\\Users\\cam\\AppData\\Local\\Temp\\npm-1324432026246\\1324432026246-0.824160692980513"
silly spawning [ 'git',
silly spawning [ 'clone',
silly spawning 'https://github.com/visionmedia/hamljs.git',
silly spawning 'C:\\Users\\cam\\AppData\\Local\\Temp\\npm-1324432026246\\1324432026246-0.824160692980513' ],
silly spawning null ]
ERR! git clone https://github.com/visionmedia/hamljs.git CreateProcessW: The system cannot find the file specified.
ERR! Error: `git "clone" "https://github.com/visionmedia/hamljs.git" "C:\\Users\\cam\\AppData\\Local\\Temp\\npm-1324432026246\\1324432026246-0.824160692980513"` failed with 127
ERR! at ChildProcess. (C:\Users\cam\AppData\Roaming\npm\node_modules\npm\lib\utils\exec.js:49:20)
ERR! at ChildProcess.emit (events.js:70:17)
ERR! at maybeExit (child_process.js:359:16)
ERR! at Socket. (child_process.js:464:7)
ERR! at Socket.emit (events.js:67:17)
ERR! at Array.1 (net.js:314:10)
ERR! at EventEmitter._tickCallback (node.js:192:40)
ERR! Report this *entire* log at:
ERR!
ERR! or email it to:
ERR!
ERR!
ERR! System Windows_NT 6.1.7601
ERR! command "node" "C:\\Users\\cam\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "git+https://github.com/visionmedia/hamljs.git" "--verbose"
ERR! cwd c:\node
ERR! node -v v0.6.6
ERR! npm -v 1.1.0-beta-7
ERR! message `git "clone" "https://github.com/visionmedia/hamljs.git" "C:\\Users\\cam\\AppData\\Local\\Temp\\npm-1324432026246\\1324432026246-0.824160692980513"` failed with 127
verbose exit [ 1, true ]

I have git for windows installed just like the github documentation says to do. Obviously there are windows-specific issues because I can only run git from inside the Git Bash. There is no windows command-line git.

However, I would like to put this as a feature request. There are times when I want to install the bleeding-edge version of a repo and it would be much easier through npm if it supported git on windows.

Is there a way to run git through the Git Bash program? I haven't researched it but presumably you can run the Git Bash as a child process and either command-line arg the "git clone" command, or else stdin-stream the "git clone" command.