Skip to content

Conversation

@artus9033
Copy link
Contributor

@artus9033 artus9033 commented Nov 11, 2025

Summary

When running yarn (tested on ver. 1.22.19), yarn bin tsc run via Node.js spawn outputs extra leading ANSI characters, causing the path to tsc to look like the following: \x1B[2K\x1B[1G/Users/<username>/<path to project>/node_modules/.bin/tsc. This causes any call to existsSync to fail (the ANSI chars are non-printable so not visible below, but printing an object with the string as value shows them encoded), showing a false-positive warning:

⚠ [typescript] Failed to locate tsc in the workspace. Falling back to the binary found in PATH at /Users/<username>/<path to project>/node_modules/.bin/tsc. Consider adding typescript to your devDependencies or specifying the tsc option for the typescript target.

Setting the env var FORCE_COLOR to 0 remediates the problem, which this PR brings.

Test plan

Run bob build in a yarn project, ensure tsc is found successfully.


Note

Runs yarn bin tsc with FORCE_COLOR=0 to avoid ANSI output and correctly detect the tsc path.

  • TypeScript target (packages/react-native-builder-bob/src/targets/typescript.ts):
    • For Yarn projects, spawn('yarn', ['bin', 'tsc']) now sets env: { ...process.env, FORCE_COLOR: '0' } to prevent ANSI characters in output and ensure accurate tsc path resolution.

Written by Cursor Bugbot for commit 7c58e71. This will update automatically on new commits. Configure here.

Copy link
Member

@satya164 satya164 left a comment

Choose a reason for hiding this comment

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

Thank you!

@satya164 satya164 merged commit 7f5952f into callstack:main Nov 12, 2025
15 checks passed
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.

2 participants