addDependencies(dependencies) {
    if (!dependencies) {
      return null;
    }

    let dependencyNames = Object.keys(dependencies);

    if (dependencyNames.length === 0) {
      return null;
    }

    let packages = Object.create(null);

    let missingDependencies = [];

    dependencyNames.forEach((dependencyName) => {
      logger.info('%s: Trying to find dependency %o', this.pkg.name, dependencyName);

      let dependencyPackage;

      // much of the time the package will have dependencies in
      // a node_modules inside it, so check there first because it's
      // quicker since we have the reference. Only check externally
      // if we don't find it there.
      if (this.nodeModules) {
        dependencyPackage = this.nodeModules.findPackage(dependencyName);
      }

      if (!dependencyPackage) {
        dependencyPackage = this.cache._findPackage(dependencyName, path.dirname(this.realPath));
      }

      if (dependencyPackage) {
        packages[dependencyName] = dependencyPackage;
      } else {
        missingDependencies.push(dependencyName);
      }
    });

    if (missingDependencies.length > 0) {
      this.addError(Errors.ERROR_DEPENDENCIES_MISSING, missingDependencies);
    }

    return packages;
  }
For each dependency in the given list, find the corresponding
PackageInfo object in the cache (going up the file tree if
necessary, as in the node resolution algorithm). Return a map
of the dependencyName to PackageInfo object. Caller can then
store it wherever they like.

Note: this is not to be  called until all packages that can be have
been added to the cache.

Note: this is for ALL dependencies, not just addons. To get just
addons, filter the result by calling pkgInfo.isForAddon().

Note: this is only intended for use from PackageInfoCache._resolveDependencies.
It is not to be called directly by anything else.

@protected
@method addDependencies
@param {PackageInfo} dependencies value of 'dependencies' or 'devDependencies'
       attributes of a package.json.
@return {Object} a JavaScript object keyed on dependency name/path with
   values the corresponding PackageInfo object from the cache.