Fix crash: npm ERR! TypeError: Cannot call method 'error' of undefined npm ERR! at handle (/Users/maciej/dev/js/npm/node_modules/npm-registry-client/lib/publish.js:79:18) npm ERR! at RegClient.<anonymous> (/Users/maciej/dev/js/npm/node_modules/npm-registry-client/lib/publish.js:88:24) npm ERR! at cb (/Users/maciej/dev/js/npm/node_modules/npm-registry-client/lib/request.js:27:9) npm ERR! at RegClient.<anonymous> (/Users/maciej/dev/js/npm/node_modules/npm-registry-client/lib/request.js:148:10) npm ERR! at cb (/Users/maciej/dev/js/npm/node_modules/npm-registry-client/lib/request.js:158:9) npm ERR! at RegClient.<anonymous> (/Users/maciej/dev/js/npm/node_modules/npm-registry-client/lib/request.js:223:20) npm ERR! at self.callback (/Users/maciej/dev/js/npm/node_modules/request/main.js:120:22) npm ERR! at Request.EventEmitter.emit (events.js:124:20) npm ERR! at ClientRequest.self.clientErrorHandler (/Users/maciej/dev/js/npm/node_modules/request/main.js:222:10) npm ERR! at ClientRequest.EventEmitter.emit (events.js:94:17)
This reduces the likelihood that there'll ever be a package that has a 'latest' version that doesn't have a tarball associated with it, and that's a good thing.
Apparently CouchDB recently stopped simply rejecting these, and instead returns a 403 from the validate_doc_update function, rather than an immediate 401. While this is undoubtedly a great security feature (since they don't leak as much info about the reason for the write rejection) it's a bit annoying when the token cookie expires sometimes. Hopefully this makes the reports go away.