code: function (version, args, pipe) {
          let spawnOpts = { cwd: ForestInternal.elmRoot(version) };
          let buffers = [];
          return new Promise((resolve, reject) => {
              let child = child_process_1.spawn('npm', args, spawnOpts);
              if (pipe) {
                  child.stdout.pipe(process.stdout);
                  child.stderr.pipe(process.stderr);
                  process.stdin.pipe(child.stdin);
                  process.stdin.resume();
              }
              child.stdout.on('data', (data) => {
                  buffers.push(data);
              });
              child.on('close', (code) => {
                  if (pipe) {
                      process.stdin.pause();
                      process.stdin.unpipe();
                  }
                  if (code === 0) {
                      let str = Buffer.concat(buffers).toString('utf-8');
                      return resolve(str);
                  }
                  // Use reject instead of throw here because we are in a callback
                  reject(new ForestError(Errors.NpmCommandFailed, `npm command failed with exit code ${code}`, code));
              });
          }).catch((err) => {
              if (err instanceof ForestError) {
                  throw err;
              }
              else {
                  throw new ForestError(Errors.NpmRunFailed, err);
              }
          });
      }
docs: /* ****************************************************************************
  Run an NPM command in the container for a specific elm version