Skip to content

EAS Build fails in PREPARE_PROJECT on pnpm monorepos with devEngines.packageManager (regression in 27.1.0) #4779

Open

Description

@banie-solink

Summary

Since eas-cli 27.1.0, EAS Build fails in the PREPARE_PROJECT phase for a pnpm monorepo when NPM_TOKEN is set. The same commit built successfully with eas-cli 26.0.0 one day earlier.

Normalizing project source permissions
We detected that you set the NPM_TOKEN environment variable
npm config get userconfig exited with non-zero code: 1

Cause

#4729 changed setUpNpmrcAsync to always run npm config get userconfig with cwd: findPackagerRootDir(workingDirectory). The step runs even when the project has its own .npmrc and when NPM_CONFIG_USERCONFIG is set.

The root package.json of our monorepo has this field:

"devEngines": {
  "runtime": { "name": "node", "onFail": "error" },
  "packageManager": { "name": "pnpm", "version": "10.25.0", "onFail": "error" }
}

npm 11 checks devEngines before it runs any command. Thus npm config get userconfig at the root exits 1:

npm error code EBADDEVENGINES
npm error EBADDEVENGINES Invalid name "pnpm" does not match "npm" for "packageManager"

Before 27.1.0, the worker logged .npmrc already exists in your project directory, skipping generation and did not run npm.

Steps to reproduce

  1. Use a pnpm monorepo with devEngines.packageManager: { "name": "pnpm", "onFail": "error" } in the root package.json.
  2. Set NPM_TOKEN in the EAS environment.
  3. Run eas build with eas-cli 27.1.0.

Local reproduction: run npm config get userconfig at the root of such a repo. It exits 1.

Suggested fix

  • Do not use npm to find the user config. Read NPM_CONFIG_USERCONFIG (or npm_config_userconfig) and fall back to ~/.npmrc.
  • Or run the npm command with a cwd outside the project, for example the home directory.

Environment

  • eas-cli 27.1.0 (last good: 26.0.0)
  • Build image: ubuntu-24.04-jdk-17-ndk-r27b-sdk-55
  • eas.json: node: 24.11.1, pnpm: 10.25.0 (npm 11.6.2)
  • Expo SDK 55

Workaround

We pinned the CLI to eas-cli@26.0.0.

Activity

  1. banie-solink commented on Oct 28, 2026

    @banie-solink
    Author

    Correction: a pin of eas-cli does not work around this issue. A build with npx eas-cli@26.0.0 failed with the same error, because the worker runs its own build-tools version. Our workaround is to set devEngines.packageManager.onFail to "warn" in the CI checkout before eas build. The uncommitted change goes into the uploaded archive.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions