hunk.code_window:  */
   export async function linkPkgBins (modules: string, target: string, preserveSymlinks: boolean) {
     const pkg = await safeRequireJson(path.join(target, 'package.json'))
     if (!pkg) {
       logger.warn(`There's a directory in node_modules without package.json: ${target}`)
       return
  
hunk.labels: keep replace keep keep keep keep keep
hunk.after_edit: export async function linkPkgBins (target: string, binDir: string, preserveSymlinks: boolean) {
  
hunk.file_path: src/install/linkBins.ts
hunk.type: replace
file: import crossSpawn = require('cross-spawn')
  import path = require('path')
  import delocalizeDeps = require('delocalize-dependencies')
  import readPkgUp = require('read-pkg-up')
  import {PnpmOptions} from '../types'
  import writePkg = require('write-pkg')
  
  export default async function (input: string[], opts: PnpmOptions) {
    if (!opts.linkLocal) {
      runNpmPublish()
    }
    const pkg = await readPkgUp({ cwd: opts.cwd, normalize: false })
    const newPkg = delocalizeDeps({
      saveExact: opts.saveExact,
      pkgDir: path.dirname(pkg.path),
      pkg: pkg.pkg
    })
    await writePkg(pkg.path, newPkg)
    try {
      await runNpmPublish()
    } finally {
      await writePkg(pkg.path, pkg.pkg)
    }
  }
  
  function runNpmPublish () {
    crossSpawn.sync('npm', process.argv.slice(2), { stdio: 'inherit' })
  }
  