mbrevoort / node-reggie

An experimental light weight alternative to a full blown npm registry
416 stars 50 forks source link

Reggie-server returns incorrect json for packages with 'dist' field in package.json #35

Closed evil-shrike closed 11 years ago

evil-shrike commented 11 years ago

If a package's package.json has 'dist' field (like packages dateformat (https://npmjs.org/package/dateformat) and tiny-lr (https://npmjs.org/package/tiny-lr) have) then this package cannot be installed from reggie repo. For a package without 'dist' field in its package.json, e.g. http://localhost:8006/gaze reggie returns correct dist with tarball:

{"_id":"gaze","_rev":"1-0","name":"gaze","description":"A globbing fs.watch wrapper built from the best parts of other fine watch libs.","dist-tags":{"latest":"0.4.1"},"versions":{"0.4.1":{"dist":{"tarball":"http://localhost:8006/gaze/-/gaze-0.4.1.tgz","shasum":"56843bc256e1a06a3767804480a7c4ab89f939f0"},"name":"gaze",

But for http://localhost:8006/tiny-lr reggie returns json without dist.tarball:

{"_id":"tiny-lr","_rev":"1-0","name":"tiny-lr","description":"Tiny LiveReload server, background-friendly","dist-tags":{"latest":"0.0.4"},"versions":{"0.0.4":{"dist":{"shasum":"d9c0fb996af743ab850e62638ae0725e5c4aee8e"},"author":{"name":"mklabs"},

Then if we ry to install such packages from reggie:

npm install dateformat --registry=http://localhost:8006

we''ll get the error:

npm http GET http://localhost:8006/tiny-lr
npm http 200 http://localhost:8006/tiny-lr
npm ERR! Error: No dist.tarball in tiny-lr@0.0.4 package
npm ERR!     at next (Z:\Prog\nodejs\node_modules\npm\lib\cache.js:748:34)
npm ERR!     at addNameVersion (Z:\Prog\nodejs\node_modules\npm\lib\cache.js:733:12)
npm ERR!     at Z:\Prog\nodejs\node_modules\npm\lib\cache.js:604:5
npm ERR!     at Z:\Prog\nodejs\node_modules\npm\lib\cache.js:1218:7
npm ERR!     at Z:\Prog\nodejs\node_modules\npm\node_modules\lockfile\lockfile.js:137:23
npm ERR!     at Z:\Prog\nodejs\node_modules\npm\node_modules\lockfile\lockfile.js:155:16
npm ERR!     at Z:\Prog\nodejs\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:103:5
npm ERR!     at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>