pnpm
pnpm copied to clipboard
Add pnpm installation methods using standard OS package managers
- [x] dnf/yum
- [x] https://github.com/pnpm/pnpm/pull/3622
- [x] apt
- [x] https://github.com/pnpm/pnpm/pull/3634
- [x] brew
- [x] chocolatey
- [x] scoop
- [ ] pacman
Related: https://github.com/pnpm/pnpm/issues/3624
For inspiration:
- https://github.com/vercel/hyper (how does it update itself?)
- https://github.com/yarnpkg/releases
For Arch Linux, an AUR already exists, so you can safely remove the "pacman" entry.
But it uses the plain js version of pnpm, not the one compiled to an executable
Khải @.***> ezt írta (időpont: 2021. aug. 1., V 12:51):
For Arch Linux, an AUR https://aur.archlinux.org/packages/pnpm/ already exists, so you can safely remove the "pacman" entry.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pnpm/pnpm/issues/3633#issuecomment-890486901, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOWTG6FTIIU6BI3PFGZPFDT2UKJBANCNFSM5BKAWMCQ .
If you still find the pacman version necessary then go for it. What I was trying to say is if you don't want to maintain too many targets then feel free to remove "pacman" from the list (I don't think it's going to be a huge impact, because Arch Linux users prefer their system to be lightweight, i.e. use nodejs
as a shared dependency instead of duplicating it).
Actually, isn't it better to just create an AUR (called pnpm-standalone
or pnpm-bundled
or whatever) that downloads and installs pnpm executables? I also have a github action that publishes PKGBUILD
and .SRCINFO
to the AUR (you have to generate the PKGBUILD
yourself, the action would then generate .SRCINFO
from provided PKGBUILD
).
I want the executable version to be the default one starting from pnpm v7. If someone would love the plain js version, we may ship that separately.
@zkochan silent installation of NodeJS is quite simple, I could help with Windows (I've built electric) so feel free to let me know what info you would need
I was trying to build the deb/rpm packages automatically with GitHub actions but no luck for now.
First I tried to do it using these tools: pkg-deb and pkg-rpm
However, the artifact generated by pkg-deb via GitHub action doesn't work when I try to use it on Ubuntu. When I built the artifact locally, it worked.
Now I am looking into nFPM. It is not as convenient as the above tools (which reuse info from package.json) but it can build both deb and rpm with no additional dependencies installed. The deb artifact built with it seems to work.
silent installation of NodeJS is quite simple
There is no need to install Node.js. pnpm is built into an executable together with Node.js. So just pnpm needs to be installed, and it will work even if there is no Node.js installed on the target system.
I think for now it will be easier to use a standalone shell script to install pnpm (I already worked on it here).
And in the future we may add support for different system package managers, if needed.
@zkochan I'm working on the pnpm Homebrew formula. Please help me. https://github.com/Homebrew/homebrew-core/pull/82892
I can look into the PR later.
If you have some specific questions, feel free to ask here or in the chatroom.
Regarding shipping pnpm binaries as independent executables, the plan is to ship them by default from pnpm v7. If you want to use the binaries for brew, they are uploaded already to the release page: https://github.com/pnpm/pnpm/releases/tag/v6.12.1
I think I can add binaries for arm architecture as well.
@zkochan Thanks for your kind responce! What I need now is the linuxstatic binary for Linuxbrew and the arm64 binary for M1 Mac.
Regarding shipping pnpm binaries as independent executables, the plan is to ship them by default from pnpm v7. If you want to use the binaries for brew, they are uploaded already to the release page: https://github.com/pnpm/pnpm/releases/tag/v6.12.1
Homebrew will never allow the prebuilt binaries for OSS. The binaries must be built from the Homebrew's definitions (formulae) and from their sources. (For example, the node's formula)
Is MacPorts going to be supported as well?
Is MacPorts going to be supported as well?
We will accept contributions that add support for any package managers and/or systems.
But for now I want to concentrate on creating a cross-platform shell script for installing pnpm on any system. As I mentioned above, I already have one in progress: https://github.com/pnpm/get/blob/main/beta-install.sh
However, we started to use the XDG desktop standard, so finding the right location is a bit hard. I think I will use the following steps to install pnpm using the standalone script:
- Download the latest tarball of pnpm
- Unpack it
- Run
pnpm setup
. pnpm setup will:- Find the correct location for the pnpm home directory
- Add the pnpm home directory to the PATH (by modifying shell bootstrap scripts)
- Move (or copy and remove) the pnpm binary to the home directory
@zkochan Will the preferred global bin be changed from writable /usr/local/bin
by respecting XDG standard?
This is essential for Homebrew.
But for now I want to concentrate on creating a cross-platform shell script for installing pnpm on any system. As I mentioned above, I already have one in progress: https://github.com/pnpm/get/blob/main/beta-install.sh
Shellcheck will help you very much. https://github.com/pnpm/get/pull/3
The XDG standard is for Linux. What should be the preferred home direrory location for pnpm on macOS?
@zkochan
The XDG standard is for Linux. What should be the preferred home direrory location for pnpm on macOS?
I suggest ~/Library/Application Support/pnpm
.
Im patiently waiting for this to be complete! (fingers crossed) as I would prefer to get the pnpm cli fully compatible with alpine and able to use pnpm env
to install nodejs on alpine linux.
I am currenlty resorting to nodejs-current apack in my repo :(
We already ship all the necessary assets. I don't have experience with any of these system package managers but it shouldn't be hard to add support for them as the assets are present
@zkochan i've resorted to installing the pnpm cli separately from the nodejs binary (using the one available in alpine contributing repo)
but i do plan on addressing this later as i use pnpm env to manage my entire node setup when on baremetal and its fkn awesome
@zkochan I think we should have our own repository dedicated to the latest pnpm binary.
All the OS standard repositories of package managers cannot catch up with the development speed of pnpm (except Homebrew afaik).
Do you know what apt install nodejs
in the latest Debian distribution installs?
_人人人人人_ > 12.22.5 <  ̄Y^Y^Y^Y^Y^ ̄
This is why Docker and Yarn have their own repository. At least with my experiences of Debian packages, pnpm needs its own repository in Debian and Ubuntu.
Building the repository would be hard but once it establishes users can use it easily because there is plenty of third-party repositories and tools to register such repositories.
I don't have objections
I will investigate how we can have our own repository in Debian and Ubuntu. We would need some hosting. Of course, I will make my best effort in the brew as you know 😉
we have a hosting on netlify
How much bandwidth do we have?
we also have cloudflare, so I am not sure why so much bandwidth is consumed.
400 GB / mo might not be enough for production but we can try. I think aptly is what we need for Debian and Ubuntu. It can publish to AWS S3.
Can we have S3-compatible cloud storage or AWS S3 as a backend of Netlify or CloudFlare? We need to find a corresponding tool to aptly in the dnf/yum world if that is true. https://www.aptly.info/doc/feature/s3/
can't we just commit to a git repo?
That cannot (I know this is technically possible but would go very messy) be automated and the size of the git repo grows rapidly. Ideally, the repository would have a new deb package on each release, and this requires automation. If that the binary version from the standard package manager is old and not the latest is acceptable, I think a git repo is a good solution.
Well, we should use a free solution if possible. S3 is not free and I would be afraid to use my card.
Many big distros provide a way to host a custom repository. Ubuntu has PPAs, Fedora has Copr, etc. I'm guessing we could benefit from them.
From searching around, you may be able to use GitHub Pages for this, for free. I found a guide that might help. The same concept likely applies for Cloudflare Pages, Netlify, etc.
@zkochan your wrong here you can make it easy if you like https://snapcraft.io/ and https://appimage.org/
If you host in a GitHub repo, you could amend the first commit every time, so the repo size stays completely under control, and will only ever have 1 commit.
Might be worth to investigate https://build.opensuse.org/ which lets you build for many linux distributions.
i still think the final solution is to port the algos in a way that npm can execute them we do not need a extra package manager. while sure why not but at last it should be compatible.
we do not need a extra package manager
Respectfully, this is off-topic and doesn't belong in this discussion
@JJRcop ok package-manager is off topic for a package-manager that has pn in its name got it even if this is also offtopic what kind of philosophie is that? Is that the mind set of all contributors here?
@frank-dspeed what makes you think that pnpm is not installable by npm?
These work:
npm i -g pnpm
# or
npm i -g @pnpm/exe
@zkochan no you got me wrong my frind sorry sure it is install able per npm no question about that my proposal was again to make the people aware that it would be clever to split the pnpm algos a bit and offer some extra cli tools as interface to maintain existing npm installs with that algos as the new workspace features in npm 8.4 + is better then the one in pnpm
and verdaccio as a proxy is nothing complex to configure for npm also
i simply want do dedup the ecosystem a bit i am working on my own coding lang and i spotted a lot of cluttered dedup able projects in the NPM Ecosystem
pnpm is one of it it is a cli for verdaccio with some defaults and extra tooling and so on as also that cli
and i see clear out of my high level view that we create the same tools over and over with diffrent defaults and all share the same packages as sub dependencies that leads to the final conclusion that all this projects would be better merged together so that they can take care of the sub dependencies that they already got.
PNPM shares issues and problems with YARN Typescript Rollup NPM VERDACCIO and all the sub dependencies and dev dependencies that all this projects inhire. And there are a lot of real urgent problems.
PNPM was a good tool and the patterns are still good but the next step is to drop none needed code and the package-manager and is not needed Maintaining existing lockfiles and some verdaccio tooling would be the ideal successor in long term.
The XDG standard is for Linux. What should be the preferred home direrory location for pnpm on macOS?
Would like to mention (a bit late) that I believe there are programs that follow the XDG standard on macos too