Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion lib/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,15 @@ function install (gyp, argv, callback) {
}
}

var distUrl = gyp.opts['dist-url'] || gyp.opts.disturl || 'https://nodejs.org/dist'
var distUrl = gyp.opts['dist-url'] || gyp.opts.disturl

if (!distUrl) {
if (semver.satisfies(version, '>=1.0.0')) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may not reliable if NodeJS released v1.0.0 someday, I prefer process.release.node === 'io.js'.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Node.js" 1.0.0 will never be released. As a TSC member, I can authoritatively say that. :)

Also, io.js is node.js now: https://github.com/nodejs/node

However, version detection still isn't a great way of doing things, though it could for for io.js 1.0.0> <3.0.0. As @camsong said, what we really should be doing now is detecting 3.0.0's process.release :)

distUrl = 'https://iojs.org/dist'
} else {
distUrl = 'https://nodejs.org/dist'
}
}

// Determine which node dev files version we are installing
var versionStr = argv[0] || gyp.opts.target || process.version
Expand Down