Permalink
Browse files

If `dependencies` is not set, default to empty object

Fixes crash when package only has `devDependencies` field.
  • Loading branch information...
1 parent fafc2e0 commit 61b757333ac7635623c258a9af640ccccd70cf10 @mmalecki mmalecki committed with isaacs Jun 19, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/install.js
View
@@ -184,6 +184,7 @@ function readDependencies (context, where, opts, cb) {
, function (er, data) {
if (er) return cb(er)
+ if (!data.dependencies) data.dependencies = {};
if (opts && opts.dev) {
Object.keys(data.devDependencies || {}).forEach(function (k) {
data.dependencies[k] = data.devDependencies[k]

0 comments on commit 61b7573

Please sign in to comment.