Skip to content

Commit

Permalink
fix: check config root for yarn
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Oct 23, 2023
1 parent cb39c84 commit 5b58de1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/yarn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import makeDebug from 'debug'
import {fork} from 'node:child_process'
import {createRequire} from 'node:module'
import {join} from 'node:path'
import {fileURLToPath} from 'node:url'
import NpmRunPath from 'npm-run-path'

import {WarningsCache} from './util.js'
Expand All @@ -26,7 +27,7 @@ export default class Yarn {
}

async exec(args: string[] = [], opts: YarnExecOptions): Promise<void> {
const bin = require.resolve('yarn/bin/yarn.js')
const bin = require.resolve('yarn/bin/yarn.js', {paths: [this.config.root, fileURLToPath(import.meta.url)]})
debug('yarn binary path', bin)
const {cwd, silent, verbose} = opts
if (args[0] !== 'run') {
Expand Down

0 comments on commit 5b58de1

Please sign in to comment.