-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
MacOS: realpath not found #34146
Comments
Same |
same |
I'm having the same issue |
same 😭 |
I fixed the issue you need to install
Make sure to clearn build folder (Product -> Clean Build Folder) |
Sorry but that is patching the problem by installing a backward compatibility shim for pre-2000 state While this commit bb8ddd6 explicitly removes the current cross-platform command. Just why? |
Same, version 0.69.3 |
To provide context here: If you list the usages that needs to be reverted back, we can address them 👍 |
same 😭😭 |
same, version 0.70.1 |
Same on MacOS 12.6, node v12.16.3, react-native 0.70.1 `Node found at: /usr/local/bin/node SyntaxError: Unexpected token '?' |
Quick heads up that node 12 is not supported by React Native. Min version is 14. |
@cortinico I just run
If I start metro myself then everything is ok. |
I'm more concerned that you see
Which is a script that is internal to React Native and you should not be calling. I'm wondering why it's there. |
same😭😭 |
Can someone please clarify if:
|
|
I'm going to close this issue as I still have a couple of open questions:
We might need to either:
I would need further context to understand what's the follow up here. |
brew install coreutils worked for me too, but right after having cleaned and rebuilt my project from xcode xcworkspace. To answer @cortinico's question, in my case I was experiencing this issue in a react native project of my own. |
@cortinico It seems it is fixed in this commit: #34145 |
This is not a good solution. This tool set has other tools, and it has the same name as the mac system's built-in tools, which can cause more problems if you set environment variables. Fix the problem the right way, not with this flaky patch. |
I suggest using the command
|
Just bumped into this in an expo bare project. Hmph. |
Just to re-iterate, this is fixed in 0.71 (at least for the packager.sh script). |
For anyone struggling with this, I found out that the |
same |
Description
The
realpath
command does not exist on MacOs.Commit bb8ddd6 uses
realpath
instead ofreadlink
.Changing this in
./scripts/packager.sh
resolved this issue for me (MacOs Montery, Silicon M1):THIS_DIR=$(cd -P "$(dirname "$(readlink -f "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd)
where
realpath
is replaced byreadlink -f
NOTE:
readlink
appears to be the more modern and more widely supported replacement forrealpath
Version
0.69.1
Output of
npx react-native info
System:
OS: macOS 12.4
CPU: (8) arm64 Apple M1
Memory: 104.45 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node
Yarn: 1.22.18 - ~/Library/pnpm/yarn
npm: 8.13.2 - ~/Development/app/node_modules/.bin/npm
Watchman: 2022.06.13.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK:
API Levels: 28, 29, 31, 32, 33
Build Tools: 28.0.3, 29.0.2, 30.0.3, 31.0.0, 32.0.0, 33.0.0
System Images: android-29 | ARM 64 v8a, android-29 | Google APIs ARM 64 v8a, android-29 | Google Play ARM 64 v8a, android-31 | ARM 64 v8a, android-31 | Google APIs ARM 64 v8a, android-31 | Google Play ARM 64 v8a, android-32 | Google APIs ARM 64 v8a, android-32 | Google Play ARM 64 v8a, android-33 | Google APIs ARM 64 v8a, android-33 | Google Play ARM 64 v8a
Android NDK: 22.1.7171670
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8609683
Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
Languages:
Java: 11.0.15 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: ^18.2.0 => 18.2.0
react-native: ^0.69.0 => 0.69.1
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Steps to reproduce
Run the Android debug build command on Mac Os:
npm run android
Watch the debugger terminal, the top line shows an error
realpath not found
Snack, code example, screenshot, or link to a repository
Users/***/node_modules/react-native/scripts/packager.sh: line 8: realpath: command not found
To reload the app press "r"
To open developer menu press "d"
The text was updated successfully, but these errors were encountered: