Skip to content

Support pnpm workspace #4188

Open

Description

@Dominic-Marcelino

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project uses.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Problem description

When using pnpm, forge requires node-linker=hoisted in the project's .npmrc configuration. If the project is a monorepo with electorn inside e.g root/app, node-linker=hoisted means all node-modules are hoisted into the root/node_modules.
However electron-forge expects the node-modules to be present in the apps-root (root/app/node_modules) and therewith wont resolve native modules during build...

Proposed solution

Support linked node-modules to be compatible with pnpm stores

Alternatives considered

Additional information

No response

Activity

  1. Dominic-Marcelino commented on Mar 24, 2026

    @Dominic-Marcelino
    Author

    Seems like a main blocker is the usage of flora-colossus, which expects the modules to exist next to the package.json. Otherwise it'll throw the error Failed to locate module "${moduleName}" from "${modulePath}" - view source

  2. xorweak commented on May 16, 2026

    @xorweak

    +1

  3. kingkongdog commented on Jul 22, 2026

    @kingkongdog

    Actually, node-linker=hoisted is not required. So I remove the logic of checking node-linker=hoisted, by pnpm patch. Then the monorepo works. The code is in @electron-forge/cli/dist/util/check-system.js, line 47.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions