medialize/URI.js — pull request #107 by kennknowles (2013-08-13 21:24:43+00:00)
Title: npm installed URIjs 1.11.1 fails to load with `TypeError: Cannot read property 'IPv6' of undefined` 

```console
$ npm install URIjs
npm http GET https://registry.npmjs.org/URIjs
npm http 200 https://registry.npmjs.org/URIjs
npm http GET https://registry.npmjs.org/URIjs/-/URIjs-1.11.1.tgz
npm http 200 https://registry.npmjs.org/URIjs/-/URIjs-1.11.1.tgz
URIjs@1.11.1 node_modules/URIjs
$ node
> require('URIjs')
TypeError: Cannot read property 'IPv6' of undefined
at ./node_modules/URIjs/src/IPv6.js:39:17
at _IPv6 (./node_modules/URIjs/src/IPv6.js:19:26)
at Object. (./node_modules/URIjs/src/IPv6.js:27:2)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at _URI (./submodules/solidstate.js/node_modules/URIjs/src/URI.js:18:57)
```

I haven't totally grokked the packaging of URIjs, or I'd attach some code.

It looks like on https://github.com/medialize/URI.js/blob/gh-pages/src/IPv6.js#L39 that `root` will always be undefined for node, due to https://github.com/medialize/URI.js/blob/gh-pages/src/IPv6.js#L19 calling `factory` with no args.

It looks like each file assumes `root` exists when generally it doesn't. Am I missing something?