1 Bugfix for --no-registry in nodejs-v0.12.2
3 diff -u -r node-v0.12.2_def/deps/npm/lib/cache/caching-client.js node-v0.12.2/deps/npm/lib/cache/caching-client.js
4 --- node-v0.12.2_def/deps/npm/lib/cache/caching-client.js 2015-04-01 01:13:01.000000000 +0300
5 +++ node-v0.12.2/deps/npm/lib/cache/caching-client.js 2015-05-18 00:47:10.738599686 +0300
7 var cacheBase = cacheFile(npm.config.get("cache"))(uri)
8 var cachePath = path.join(cacheBase, ".cache.json")
10 + if (parsed.host === "noregistry") (function() {
12 + var file = npm.config.get("cache") + parsed.pathname + "/.cache.json"
14 + stat = fs.statSync(cachePath)
17 + stat = fs.statSync(file)
20 + stat = "Registry not defined and registry files not found: \"" +
21 + cachePath + "\", \"" + file + "\"."
22 + throw new Error(stat)
26 // If the GET is part of a write operation (PUT or DELETE), then
27 // skip past the cache entirely, but still save the results.
28 if (uri.match(/\?write=true$/)) {
33 + if (parsed.host === "noregistry")
34 + throw new Error("File \"" + cachePath+"\"" + " corrupted.")
40 - get_.call(client, uri, cachePath, params, cb)
41 + if (parsed.host === "noregistry")
42 + cb(null, data, JSON.stringify(data), { statusCode : 304 })
44 + get_.call(client, uri, cachePath, params, cb)
48 diff -u -r node-v0.12.2_def/deps/npm/lib/utils/map-to-registry.js node-v0.12.2/deps/npm/lib/utils/map-to-registry.js
49 --- node-v0.12.2_def/deps/npm/lib/utils/map-to-registry.js 2015-04-01 01:13:01.000000000 +0300
50 +++ node-v0.12.2/deps/npm/lib/utils/map-to-registry.js 2015-05-18 01:15:10.030569613 +0300
53 log.silly("mapToRegistry", "registry", registry)
55 + if (!registry) return cb(null, "http://noregistry/" + name, {})
57 var auth = config.getCredentialsByURI(registry)
59 // normalize registry URL so resolution doesn't drop a piece of registry URL