-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
chore: Switch from NPM to PNPM #1811
Comments
BTW, most problems I've seen when switching from NPM to PNPM were along the lines of "package foo not found" from package bar, which relied on foo but didn't have it in its I encountered one such problem when running |
Since PNPM uses links internally inside node_modules, if you copy node_modules from your dev machine into a Docker container, it can result in an error similar to the following:
We already want to move the npm install step inside the Dockerfiles anyway (and #1653 tracks that desire), so I'll just solve #1653 as part of the PR that solves this issue. |
Is your feature request related to a problem? Please describe.
I'd like to use PNPM rather than NPM for managing packages in Language Forge. I often want to have two copies of the LF source code on my hard disk, one pristine copy of the
develop
ormaster
branch and another one with a branch checked out that I'm currently working on. With NPM, that means two copies of the nearly 300-megabytenode_modules
folder. With PNPM, those copies would be linked and I'd have only one copy of each NPM package, saving me at least 300 megabytes. (And probably more, because any packages that are also used by LexBox or other projects would have only one copy on my hard disk). As the hard disk in my dev machine is a little tight for space, that extra 300 megabytes would help quite a bit.Describe the solution you'd like
Run
pnpm import
to convertpackage-lock.json
topnpm-lock.yaml
, then find and fix any problems. (Which are rare, but at least once I've run into a package that assumed thatnode_modules
had a specific layout, whereas pnpm uses a different layout innode_modules
. 99% of the time it Just Works™.)Describe alternatives you've considered
Leaving things as-is with the extra space used up by those redundant
node_modules
directories.Additional context
PNPM used to be an obscure package manager, but it's very well-known by now. (See usage graph below. Source: https://npm-compare.com/pnpm/#timeRange=THREE_YEARS accessed 2024-05-10). The Svelte team uses it, as do many others, because reusing NPM packages usually means much faster runs of
pnpm install
. (Assuming your CI infrastructure has a PNPM cache set up, which isn't that hard to do if GitHub Actions doesn't have it by default).The text was updated successfully, but these errors were encountered: