Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yarn PnP support #209

Closed
AnhNhan opened this issue Feb 6, 2022 · 2 comments · Fixed by #269
Closed

Yarn PnP support #209

AnhNhan opened this issue Feb 6, 2022 · 2 comments · Fixed by #269

Comments

@AnhNhan
Copy link

AnhNhan commented Feb 6, 2022

Hello,

currently this package makes fixed assumptions about the node_modules folder, which is not a given when using Yarn 2 in Plug-and-Play mode.

It would be better to use require.resolve(), e.g.

// this here
const npm3Path = path.resolve(__dirname, '..', target);

// becomes this
const npm3Path = require.resolve('@ffprobe-installer/' + target + '/' + binary)

// example
require.resolve('@ffprobe-installer/win32-x64/ffprobe.exe')

// returns
const result = 'C:\\Users\\user\\dev\\project\\.yarn\\unplugged\\@ffprobe-installer-win32-x64-npm-5.0.0-6664c83f60\\node_modules\\@ffprobe-installer\\win32-x64\\ffprobe.exe';
@milkcoke
Copy link

I'm also waiting this issue is resolved.

@SavageCore
Copy link
Owner

I myself don't use Yarn PnP but happy to receive a full PR also covering npm2Path (if needed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants