Ignore invalid ranges

They cannot be cache since multiple commits/branches may
map to the same version number which would lead to
unpredictable results.
This commit is contained in:
Kevin Sawicki
2014-10-07 15:37:47 -07:00
committed by Kevin Sawicki
parent 1bf8f516c3
commit 2954aacb1c

View File

@@ -45,10 +45,8 @@ loadFolderCompatibility = (modulePath, rootPath, rootMetadata, moduleCache) ->
try
new semver.Range(version)
catch error
invalidVersion = version
version = JSON.parse(fs.readFileSync(path.join(nodeModulesPath, name, 'package.json')))?.version
dependencies[name] = version
console.log "Normalized #{name}: #{invalidVersion} -> #{version}"
delete dependencies[name]
console.log "Ignoring invalid range: #{name} #{version}"
onDirectory = (childPath) ->
path.basename(childPath) isnt 'node_modules'