Skip to content

Commit

Permalink
fix(npm ls): resolve to correct version
Browse files Browse the repository at this point in the history
When spec is "latest", resolveVersion resolves to most oldest version.
  • Loading branch information
yumetodo authored Sep 23, 2017
1 parent 7a971d1 commit 710c27c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/nodist/nodist.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func resolveVersion(spec string, installed []*semver.Version) (version string, e
}

if spec == "latest" {
version = installed[0].String()
version = installed[len(installed)-1].String()
}else{
for _, v := range installed {
debug("checking %s against %s", v.String(), spec)
Expand Down

0 comments on commit 710c27c

Please sign in to comment.