Skip to content
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

Incorrect usage of npm ci in pnpm scenarios. #744

Open
joshwlewis opened this issue Dec 4, 2023 · 0 comments
Open

Incorrect usage of npm ci in pnpm scenarios. #744

joshwlewis opened this issue Dec 4, 2023 · 0 comments

Comments

@joshwlewis
Copy link
Member

For builds that have a pnpm-lock.yaml (and no other lockfiles), but don't have a packageManager field in package.json, the current heroku/nodejs buildpack attempts to install dependencies with npm ci. Not only is this using the wrong package manager, it's also attempting to fetch dependencies without a lockfile.

Potentially, there are a few ways to fix this:

  • Introduce a heroku/pnpm-engine buildpack that could install pnpm in the same manner as our heroku/npm-engine buildpack. That would allow us to provide a pnpm installation using engines.pnpm from package.json, or perhaps provide a default pnpm.
  • Add a check into the heroku/npm-install buildpack to throw an error message if there is lockfile from another package manager (like pnpm-lock.yaml). Something like "Detected pnpm-lock.yaml. If you wish to use pnpm, add packageManager: "[email protected]" to your package.json".
  • Add a check into the heroku/npm-install buildpack to throw an error message if there isn't a package-lock.json. Something like "We detected npm, but found no package-lock.json. Please run npm i, commit the package-lock.json, and try again".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant