You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In an old nodejs project, I automatically get +yarnpkg.com added, but I manually added +classic.yarnpkg.com. However, I end up with a conflict. I have both versions of yarn installed, and the latest is the one that gets run from yarn. Can I somehow exclude that package from being picked up by pkgx?
The - trick is neat, I didn't know about it, thanks a lot.
In this old project I have a yarn.lock, so I'm getting yarnpkg.com. When I try adding "pkgx": "-yarnpkg.com" to my package.json then I get the following error:
dev
× nothing provides: -yarnpkg.com
│ we haven’t pkgd this yet. can you?
╰─➤ https://docs.pkgx.sh/pantry
But without it, I get the yarnpkg.com package loaded. Is there a way round this, or am I making another mistake here somewhere?
@jhheider That's awesome, thanks a lot. You're absolutely right, ordering does fix the issue I'm facing. 🥳 Would be awesome if -foo worked in spec files also, but I'm totally satisfied with the workaround.
Thanks again for working on pkgx and for all the help you've given me, I really appreciate it. 🧡
Activity
jhheider commentedon Dec 5, 2024
You can do
env -yarnpkg.comto remove it. As currently constituted:https://github.com/pkgxdev/pkgx/blob/f28d9311eac07c0dd0b4c3900eab2420199b6604/src/utils/devenv.ts#L76-L86
.yarnrcbrings in v1, andyarn.lock and .yarnrc.ymlbring in berry.chmac commentedon Dec 7, 2024
The
-trick is neat, I didn't know about it, thanks a lot.In this old project I have a
yarn.lock, so I'm gettingyarnpkg.com. When I try adding"pkgx": "-yarnpkg.com"to mypackage.jsonthen I get the following error:But without it, I get the
yarnpkg.compackage loaded. Is there a way round this, or am I making another mistake here somewhere?jhheider commentedon Dec 7, 2024
I don't believe you can do it in a spec file. Only manually, using the
envshell function created by thedevinstance.I believe ordering should be maintained, so if you put both in you spec file with
classicfirst, that should get you what you want.chmac commentedon Dec 7, 2024
@jhheider That's awesome, thanks a lot. You're absolutely right, ordering does fix the issue I'm facing. 🥳 Would be awesome if
-fooworked in spec files also, but I'm totally satisfied with the workaround.Thanks again for working on pkgx and for all the help you've given me, I really appreciate it. 🧡