anchor.diff:  
         # If source was a file, repackage it, so npm pre/post publish hooks are not triggered,
         if [[ -f $src ]]; then
  -        tar --exclude='build-dir' -czf build-dir/package.tgz ./
  +        GZIP=-1 tar -czf ../build-dir/package.tgz ./
           export src=$HOME/package.tgz
         else
           export src=$PWD
         fi
   
         # Install package
  -      (cd $HOME && npm --registry http://www.example.com --nodedir=${sources} install $src ${npmFlags})
  +      (cd $HOME && npm --registry http://www.example.com --nodedir=${sources} install $src --fetch-retries 0 ${flags})
   
         runHook postBuild
       '';
  
positive.code:       mkdir -p node_modules
        ${concatMapStrings (dep: ''
          ln -sfv ${dep}/lib/node_modules/${dep.pkgName} node_modules/
        '') deps}
        ${postShellHook}
      '';
  
      passthru.pkgName = pkgName;
    } // (filterAttrs (n: v: n != "deps" && n != "resolvedDeps") args) // {
      name = "${nodejs.interpreterName}-${name}";
  
      # Run the node setup hook when this package is a build input
      propagatedNativeBuildInputs = (args.propagatedNativeBuildInputs or []) ++ [ nodejs ];
  
      # Make buildNodePackage useful with --run-env
      nativeBuildInputs = (args.nativeBuildInputs or []) ++ deps ++ peerDependencies ++ neededNatives;
  
      # Expose list of recursive dependencies upstream, up to the package that
      # caused recursive dependency
      recursiveDeps = (flatten (map (d: remove name d.recursiveDeps) deps)) ++ (attrNames recursiveDeps);
    });
  
  in self
  
negative.code: with stdenv.lib;
  
  let
    self = let
      sources = runCommand "node-sources" {} ''
        tar --no-same-owner --no-same-permissions -xf ${nodejs.src}
        mv $(find . -type d -mindepth 1 -maxdepth 1) $out
      '';
  
      platforms = fold (entry: platforms:
        let
          filterPlatforms = attrByPath [(removePrefix "!" entry)] [] stdenv.lib.platforms;
        in
          if hasPrefix "!" entry then
            filter (p: any (f: p != f) filterPlatforms) platforms
          else
            filter (p: any (f: p == f) filterPlatforms) platforms
      ) nodejs.meta.platforms os;
  
      mapDependencies = deps: f: rec {
        # Convert deps to attribute set
        attrDeps = if isAttrs deps then deps else
          (listToAttrs (map (dep: nameValuePair dep.name dep) deps));
  
        # All required node modules, without already resolved dependencies
        # Also override with already resolved dependencies
        requiredDeps = mapAttrs (name: dep:
          dep.override {
            resolvedDeps = resolvedDeps // { "${name}" = self; };
          }
        ) (filterAttrs f (removeAttrs attrDeps (attrNames resolvedDeps)));
  
        # Recursive dependencies that we want to avoid with shim creation
        recursiveDeps = filterAttrs f (removeAttrs attrDeps (attrNames requiredDeps));
      };
  
      _dependencies = mapDependencies deps (name: dep:
        dep.pkgName != pkgName);
      _optionalDependencies = mapDependencies optionalDependencies (name: dep:
        any (platform: stdenv.system == platform) dep.meta.platforms &&
        all (d: d != dep.pkgName) skipOptionalDependencies
      );
      _peerDependencies = mapDependencies peerDependencies (name: dep:
        dep.pkgName != pkgName);
  
      requiredDependencies =
        _dependencies.requiredDeps //
        _optionalDependencies.requiredDeps //
        _peerDependencies.requiredDeps;
  
      recursiveDependencies =
        _dependencies.recursiveDeps //
        _optionalDependencies.recursiveDeps //
        _peerDependencies.recursiveDeps;
  
      patchShebangs = dir: ''
        node=`type -p node`
        coffee=`type -p coffee || true`
        find -L ${dir} -type f -print0 | xargs -0 grep -Il . | \
        xargs sed --follow-symlinks -i \
            -e 's@#!/usr/bin/env node@#!'"$node"'@' \
            -e 's@#!/usr/bin/env coffee@#!'"$coffee"'@' \
            -e 's@#!/.*/node@#!'"$node"'@' \
            -e 's@#!/.*/coffee@#!'"$coffee"'@' || true
      '';
  
    in stdenv.mkDerivation ({
  