npm 5.0.1 can't install a specific git dependency #16898
Description
I'm opening this issue because:
- npm is crashing.
- npm is producing an incorrect install.
- npm is doing something I don't understand.
- Other (see below for feature requests):
What's going wrong?
When I try to install a package which uses a particular git repository at a specific commit, npm tries to git clone
with the wrong branch and the clone fails. The specific spec is https://github.com/github/hubot-slack.git#87f012a8112d52261e1572e05c545b5ae59ababd
(or its shorthand github/hubot-slack#87f012a8112d52261e1572e05c545b5ae59ababd
). Instead of trying to clone at that commit, npm runs the following command:
/usr/local/bin/git clone --depth=1 -q -b 11/head https://github.com/github/hubot-slack.git
e.g., it's trying to clone branch 11/head
. I'm not sure where it's getting that from. npm 3 does fetch this repository/reference correctly.
Sorry if this is reported in the wrong project. :) I stepped a module or two down the dependency tree but couldn't quite place what code is responsible for doing the clone and preparing its arguments.
How can the CLI team reproduce the problem?
The following package.json, with a single dependency, reproduces the problem:
{
"name": "repro",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"hubot-slack": "https://github.com/github/hubot-slack.git#87f012a8112d52261e1572e05c545b5ae59ababd"
}
}
The debug log is here: https://gist.github.com/283f0f4484d3a8dd7b0cf31acda81b40
supporting information:
npm -v
prints: 5.0.1node -v
prints: v8.0.0npm config get registry
prints: https://registry.npmjs.org/- Windows, OS X/macOS, or Linux?: macOS 10.12
- Network issues:
- Geographic location where npm was run: Vancouver, Canada
- I use a proxy to connect to the npm registry.
- I use a proxy to connect to the web.
- I use a proxy when downloading Git repos.
- I access the npm registry via a VPN
- I don't use a proxy, but have limited or unreliable internet access.
- Container:
- I develop using Vagrant on Windows.
- I develop using Vagrant on OS X or Linux.
- I develop / deploy using Docker.
- I deploy to a PaaS (Triton, Heroku).