Skip to content

Commit

Permalink
Support npm5
Browse files Browse the repository at this point in the history
npm5 installs modules and changes their `package.json`::`version` field to be something like
```
  "version": "https://registry.npmjs.org/rn-nodeify/-/rn-nodeify-7.0.1.tgz",
```
instead of
```
  "version": "7.0.1",
```

This commit adds support for that first type of string but also supports npm4.
  • Loading branch information
staltz committed Jun 5, 2017
1 parent 8d291f4 commit 9db38f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ function installShims (modulesToShim, done) {
install = false
}
} else {
var existingVer = pkgJson.version
var existingVerNpm5 = (/\-([^\-]+)\.tgz/.exec(pkgJson.version) || [null, null])[1]
var existingVer = existingVerNpm5 || pkgJson.version
if (semver.satisfies(existingVer, allShims[name])) {
install = false
}
Expand Down

0 comments on commit 9db38f5

Please sign in to comment.