WARNING: This installation method is not supported anymore.
so instead of using this outdated method to install pnpm this PR is switching the code over to using npm install --global instead (see https://pnpm.io/installation#using-npm).
I first tried using their standalone script (see https://pnpm.io/installation#using-a-standalone-script), but that would require us to source a bash script at a generated location which makes the installation a little brittle. Since installation via npm is also officially supported and fast enough we can use that instead. The "quiet" installation via npm is modeled after how it's done in the install_npm() function too.
I've also taken the opportunity to adjust the code so that it will also install pnpm if engines.pnpm is set, but there is no pnpm lockfile. This matches the behavior for yarn now.
https://www.npmjs.com/package/@pnpm/self-installer?activeTab=readme says:
so instead of using this outdated method to install
pnpm
this PR is switching the code over to usingnpm install --global
instead (see https://pnpm.io/installation#using-npm).I first tried using their standalone script (see https://pnpm.io/installation#using-a-standalone-script), but that would require us to
source
a bash script at a generated location which makes the installation a little brittle. Since installation via npm is also officially supported and fast enough we can use that instead. The "quiet" installation via npm is modeled after how it's done in theinstall_npm()
function too.I've also taken the opportunity to adjust the code so that it will also install
pnpm
ifengines.pnpm
is set, but there is no pnpm lockfile. This matches the behavior for yarn now.Resolves https://github.com/unfold/heroku-buildpack-pnpm/issues/39