yarn recommended over pnpm?
Why is yarn recommended in the sapphire CLI over PNPM when PNPM is known to be the faster and more efficient package manager
Solution:Jump to solution
Yarn v4 is new version of Yarn that we recommend switching to as Yarn v1 has long since been deprecated.
"But I don't see any update on [source]?"That is correct. Yarn v4 is installed through Yarn itself. You configure Yarn v4 on a per-project basis. How you installed Yarn globally is largely irrelevant to this (corepack, volta, something else). How to install Yarn v4 for your project? Simply write:...
6 Replies
It's about on par if not worse with Yarn (assuming you're not using an ancient version)
and pnpm is known to be janky with sapphire, apparently
Just use whichever you prefer
You may be comparing pnpm with Yarn v1 instead of Yarn v4 regarding speed because otherwise it's definitely on par if not faster.
as for why pnpm doesnt work well with sapphire: https://discord.com/channels/737141877803057244/1168008762049712128/1168964583860486154
I see. With that in mind, I decided to convert to yarn from pnpm. After running
yarn install
no node_modules/ folder is generated, why?Solution
Yarn v4 is new version of Yarn that we recommend switching to as Yarn v1 has long since been deprecated.
"But I don't see any update on [source]?"That is correct. Yarn v4 is installed through Yarn itself. You configure Yarn v4 on a per-project basis. How you installed Yarn globally is largely irrelevant to this (corepack, volta, something else). How to install Yarn v4 for your project? Simply write: This will download the new Yarn v4 binary and put in
.yarn/releases
, you should push this to your Git repository. It will also create a .yarnrc.yml
file which configures the path which you should also commit.
Next you probably also want to run the following 2 commands:
This will add to your .yarnrc
file:
This ensures you have a more traditional experience with node_modules
and a global cache.
The next step is to nuke your node_modules
and yarn.lock
and run yarn install
Then some final adjustments. Put this in you .gitignore
:
And anywhere in your scripts in package.json where you use *
you should wrap it in extra "
For example:
Mind you this last thing is a good thing to add regardless of script runner / package bundler because it ensures the glob is performed by the library and not by your shell, which may differ when people develop on different operating systems.
In short, the command to set everything up you can run:
Run those commands to configure it properly @Upsided
oh wowza
neat thanks
Also I've never used yarn before, it's kinda misleading how like the first 5 articles if you look up "yarn vs pnpm speed" or something of that sort say pnpm is leagues faster