Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't find 'node' binary to build React Native bundle #22918

Closed
radjivF opened this issue Jan 9, 2019 · 6 comments
Closed

Can't find 'node' binary to build React Native bundle #22918

radjivF opened this issue Jan 9, 2019 · 6 comments
Labels
Bug Resolution: Locked This issue was locked by the bot. Tech: Bundler 📦 This issue is related to the bundler (Metro, Haul, etc) used.

Comments

@radjivF
Copy link

radjivF commented Jan 9, 2019

Environment

Environment:
OS: macOS 10.14.1
Node: 8.11.2
Yarn: Not Found
npm: 5.6.0
Watchman: 4.9.0
react-native: 0.55.4,
Xcode: Xcode 10.1 Build version 10B61
Android Studio: 3.2 AI-181.5540.7.32.5056338

Packages: (wanted => installed)
react: 16.3.1 => 16.3.1

Description

I cant build my app on iOS anymore,


❌  error: Can't find 'node' binary to build React Native bundle```

Can you help? I have tried everything I could find on the previous issues
@react-native-bot react-native-bot added the Tech: Bundler 📦 This issue is related to the bundler (Metro, Haul, etc) used. label Jan 9, 2019
@tristankenney
Copy link

tristankenney commented Jan 21, 2019

I was able to workaround the issue using this answer from StackOverflow

ln -s $(which node) /usr/local/bin/node

@bartolkaruza
Copy link

Hey, this looks like an environment issue. 'Can't find node binary' is triggered when the Node.js installation is invalid. Try checking your path and the workaround mentioned. If you think this is an actual issue on RN side, provide us with a minimal repro and we'll have a look again.

@MaffooBristol
Copy link

I would recommend against symbolically linking your node binary; it can cause issues elsewhere. Instead set the binary within XCode as it suggests in the error:

image

@aryo
Copy link

aryo commented Oct 17, 2019

For the people coming across this error that have added node args via the NODE_BINARY env variable (e.g. export NODE_BINARY='node --max_old_space_size=4096'), you should instead be setting NODE_ARGS:
export NODE_ARGS='--max_old_space_size=2048'

(as of #22423)

@MaffooBristol
Copy link

I actually semi-redact my previous comment. Although it works fine when there's only one person working on the project, it causes issues if more than one person wants to use the same xcode file. Also breaks things like appcenter.ms which has no knowledge of your local file structure!

@tomquas
Copy link

tomquas commented Feb 14, 2020

@MaffooBristol sorry to disappoint you, but your proposed solution (xcode build phase - /usr/local/opt/node@12/bin/node) did not have any effect on my freshly created app, metro could not find a node binary; only creating the symbolic link proposed by @tristankenney eventually made it work.

xcode 11.3.1

@facebook facebook locked as resolved and limited conversation to collaborators Mar 20, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Resolution: Locked This issue was locked by the bot. Tech: Bundler 📦 This issue is related to the bundler (Metro, Haul, etc) used.
Projects
None yet
Development

No branches or pull requests

8 participants