fix(view): fix git specs by wraithgar · Pull Request #3209 · npm/cli (original) (raw)

This was working by coincidence in 7.7.6 and before, and broken in the 7.8.0
refactor. Before, it would see there was no "name" in the spec, and then read
your local package.json, and from that get a latest tag. So, if you didn't
have a package.json in your CWD it would fail with an ENOENT trying to read it.

This fixes it for real, so that if you are asking for info from a git spec, it
goes ahead and looks for the latest tag (or whatever tag you have configured
as your default).

References

Related to nodejs/citgm#862