Skip to content

Commit

Permalink
fix: resolve yarn from plugin and config.root
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Oct 23, 2023
1 parent 42bd760 commit aa86e2a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 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 @@ -24,7 +25,8 @@ export default class Yarn {

constructor({config}: {config: Interfaces.Config}) {
this.config = config
this.bin = require.resolve('yarn/bin/yarn.js')
this.bin = require.resolve('yarn/bin/yarn.js', {paths: [fileURLToPath(import.meta.url), config.root]})
debug('yarn binary path', this.bin)
}

async exec(args: string[] = [], opts: YarnExecOptions): Promise<void> {
Expand Down

0 comments on commit aa86e2a

Please sign in to comment.