Skip to content

Install fails without global Yarn #788

@mitchchn

Description

@mitchchn

Operating System

Repro'ed on macOS (Tahoe) and Linux

Expected Behavior

npm i -g @electron/build-tools should succeed if I have the prerequisites in the docs.

Actual Behavior

Installation fails due to missing yarn:

mitch@Cobalt ~> npm i -g @electron/build-tools
npm error code 1
npm error path /opt/homebrew/lib/node_modules/@electron/build-tools
npm error command failed
npm error command sh -c node preinstall.js
npm error Your branch is up to date with 'origin/main'.
npm error HEAD is now at 4da036f build(deps): bump debug from 4.1.1 to 4.4.3 (#773)
npm error Already on 'main'
npm error npm warn exec The following package was not found and will be installed: [email protected]
npm error npm error code ENOENT
npm error npm error syscall open
npm error npm error path /Users/mitch/.npm/_npx/c094c3349f8dd527/package.json
npm error npm error errno -2
npm error npm error enoent Could not read package.json: Error: ENOENT: no such file or directory, open '/Users/mitch/.npm/_npx/c094c3349f8dd527/package.json'
npm error npm error enoent This is related to npm not being able to find a file.
npm error npm error enoent
npm error npm error A complete log of this run can be found in: /Users/mitch/.npm/_logs/2026-01-03T22_28_42_130Z-debug-0.log
npm error Failed to install build-tools:  Error: Command "yarn install" failed with exit code 254
npm error     at throwForBadSpawn (/opt/homebrew/lib/node_modules/@electron/build-tools/preinstall.js:13:11)
npm error     at install (/opt/homebrew/lib/node_modules/@electron/build-tools/preinstall.js:56:5)
npm error     at Object.<anonymous> (/opt/homebrew/lib/node_modules/@electron/build-tools/preinstall.js:77:1)
npm error     at Module._compile (node:internal/modules/cjs/loader:1760:14)
npm error     at Object..js (node:internal/modules/cjs/loader:1893:10)
npm error     at Module.load (node:internal/modules/cjs/loader:1480:32)
npm error     at Module._load (node:internal/modules/cjs/loader:1299:12)
npm error     at TracingChannel.traceSync (node:diagnostics_channel:322:14)
npm error     at wrapModuleLoad (node:internal/modules/cjs/loader:244:24)
npm error     at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:154:5)
npm notice
npm notice New minor version of npm available! 11.6.0 -> 11.7.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.7.0
npm notice To update run: npm install -g [email protected]
npm notice
npm error A complete log of this run can be found in: /Users/mitch/.npm/_logs/2026-01-03T22_28_40_207Z-debug-0.log

To Reproduce

Uninstall yarn globally if you have it: npm remove -g yarn.

Then try to install build tools. The error will appear until yarn is installed globally.

Screenshots

Additional Information

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