Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2013-07-11 11:23:08 +0400
committerisaacs <i@izs.me>2013-07-11 11:23:08 +0400
commiteb205fe60b5718f54735c357a01e38b7728846aa (patch)
tree8eae0a3e7400c2018bfc8d467bce3c9d2dcdc48d /node_modules/node-gyp/lib/configure.js
parent4c38a23096d0087fbe5ce81c2b1556b06db8cf9d (diff)
node-gyp@0.10.6
Diffstat (limited to 'node_modules/node-gyp/lib/configure.js')
-rw-r--r--node_modules/node-gyp/lib/configure.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/node_modules/node-gyp/lib/configure.js b/node_modules/node-gyp/lib/configure.js
index 437b839ca..37c9ad37d 100644
--- a/node_modules/node-gyp/lib/configure.js
+++ b/node_modules/node-gyp/lib/configure.js
@@ -101,7 +101,12 @@ function configure (gyp, argv, callback) {
log.silly('stripping "+" sign(s) from version')
version = version.replace(/\+/g, '')
}
- if (semver.gte(version, '2.5.0') && semver.lt(version, '3.0.0')) {
+ if (~version.indexOf('rc')) {
+ log.silly('stripping "rc" identifier from version')
+ version = version.replace(/rc(.*)$/ig, '')
+ }
+ var range = semver.Range('>=2.5.0 <3.0.0');
+ if (range.test(version)) {
getNodeDir()
} else {
failPythonVersion(version)
@@ -209,7 +214,11 @@ function configure (gyp, argv, callback) {
}
// make sure we have a valid version
- version = semver.parse(versionStr)
+ try {
+ version = semver.parse(versionStr)
+ } catch (e) {
+ return callback(e)
+ }
if (!version) {
return callback(new Error('Invalid version number: ' + versionStr))
}