async install(name, options = {}) {
      let versionToInstall
      const version = options.version || null
      const middleware = options.middleware || (() => Promise.resolve())

      console.group('[npm] Install package', name)

      try {
        const resJson = await fetch(`${API_BASE}${name}`).then((response) => response.json())

        versionToInstall = version || resJson['dist-tags'].latest
        console.log('Version:', versionToInstall)
        await installPackage(
          resJson.versions[versionToInstall].dist.tarball,
          path.join(dir, 'node_modules', name),
          middleware
        )

        const json = getConfig()
        json.dependencies[name] = versionToInstall
        console.log('Add package to dependencies')
        setConfig(json)
        console.log('Finished installing', name)
        console.groupEnd()
      } catch (err) {
        console.log('Error in package installation')
        console.log(err)
        console.groupEnd()
      }
    }
Install npm package
@param  {String} name Name of package in npm registry

@param  {Object} options
            version {String} Version of npm package. Default is latest version
            middleware {Function<Promise>}
              Function that returns promise. Called when package's archive is extracted
              to temp folder, but before moving to real location
@return {Promise}