Skip to content

Fix yarn berry pnpm linker - #783

Open
fusion2004 wants to merge 1 commit into
railwayapp:mainfrom
fusion2004:fix-yarn-berry-pnpm-linker
Open

fusion2004 wants to merge 1 commit into
railwayapp:mainfrom
fusion2004:fix-yarn-berry-pnpm-linker

Conversation

@fusion2004

Copy link
Copy Markdown

Motivation

Deploying node apps using yarn berry's pnpm linker fail to run because they can't load any npm packages

Description

Appends the node_modules directory to the install folders, the same carve-out we have for the node-modules linker. (And the default case, which means that is also how pnpm itself works with railpack.)

Test

Added a specific example, like we do for the yarn berry node-modules linker, and ensured integration tests passed.

installFolders := []string{"/app/.yarn", p.getYarnBerryGlobalFolder(ctx)}
if p.getYarnBerryNodeLinker(ctx) == "node-modules" {
// both the node-modules and pnpm linkers install into node_modules
if p.getYarnBerryNodeLinker(ctx) != "pnp" {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This made sense to me because yarn only supports the 3 linkers:

  • node-modules
  • pnpm
  • pnp

If you prefer an opt-in, I can switch it.

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant