npm install failing on Windows due to #branch syntax?

Running Windows 7, MinGW32, Node 5.7.0, npm 3.6.0

My package.json has the following:

"devDependencies": {
  "gulp": "gulpjs/gulp#4.0"

Running npm install gets the following error:

npm ERR! git rev-list -n1 4.0: fatal: ambiguous argument    
'4.0':unknown revision or path not in the working tree.

But if I run this:

$ npm install "gulpjs/gulp#4.0"

It (usually) succeeds.

Based on searching around, I thought perhaps the ‘#’ needed to be escaped, but I’ve tried \# and all kinds of single and double quote combinations with no luck. Am I barking up the wrong tree?


I should mention that using the same package.json on OS X always runs fine.

A colleague mentioned she was having trouble pointing to github repos in package.json and had to prefix it like so: "some-package" : "github:someuser/somepackage"

This syntax also solved my issue on windows:

"devDependencies": {
  "gulp": "github:gulpjs/gulp#4.0"

So problem solved but would love to know what the explanation is if there are any takers.

Git Baby is a git and github fan, let's start git clone.