I'd like some help getting a stock app running following the official Getting Started.
I downloaded iOS simulator 14.3.
I run
npx react-native init nuproject
cd nuproject
npx react-native run-ios
I get
nvm is not compatible with the "PREFIX" environment variable: currently set to "/Users/me/.asdf/installs/nodejs/15.8.0/.npm"
Run `unset PREFIX` to unset it.
nvm is not compatible with the "PREFIX" environment variable: currently set to "/Users/me/.asdf/installs/nodejs/15.8.0/.npm"
Run `unset PREFIX` to unset it.
Command PhaseScriptExecution failed with a nonzero exit code
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/me/Library/Developer/Xcode/DerivedData/nuproject-enujsutisqszfkeohcvaepmqnist/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-C635E97B268646534DBB9F9667109A6E.sh
(1 failure)
Here's my react-native env if it can help
$ npx react-native info
info Fetching system and libraries information...
System:
OS: macOS 11.2.3
CPU: (4) x64 Intel(R) Core(TM) i7-7660U CPU # 2.50GHz
Memory: 80.10 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 15.8.0 - ~/.asdf/installs/nodejs/15.8.0/bin/node
Yarn: 1.22.10 - ~/.asdf/installs/nodejs/15.8.0/.npm/bin/yarn
npm: 7.5.1 - ~/.asdf/installs/nodejs/15.8.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
Android SDK:
API Levels: 29
Build Tools: 28.0.3, 29.0.2, 29.0.3
System Images: android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.1 AI-201.8743.12.41.7199119
Xcode: 12.4/12D4e - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_242 - /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/bin/javac
npmPackages:
#react-native-community/cli: Not Found
react: 17.0.1 => 17.0.1
react-native: 0.64.0 => 0.64.0
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
Turns out I hadn't fully removed nvm from my system.
rm -rf ~/.nvm
And that fixed it.
Seems kinda straightforward, that your solution might be to make sure the PREFIX variable is unset.
One alternative you have is to install Node via NVM rather than managing Node within ASDF environment. I use ASDF environment also but I dont use ASDF for python or node. For those, i manage the installs outside of ASDF.
Related
Description
So I installed a library and since then I kept getting this error, I have tried for hours to fix it but it wouldn't work.
Version
0.70.6
Output of npx react-native info
System:
OS: Windows 10 10.0.19045
CPU: (16) x64 AMD Ryzen 7 5700G with Radeon Graphics
Memory: 1.39 GB / 15.87 GB
Binaries:
Node: 16.15.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
npm: 8.10.0 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK:
AllowDevelopmentWithoutDevLicense: Enabled
Versions: 10.0.19041.0
IDEs:
Android Studio: Version 2021.1.0.0 AI-211.7628.21.2111.8309675
Visual Studio: 17.1.32414.318 (Visual Studio Community 2022)
Languages:
Java: 11.0.12
npmPackages:
#react-native-community/cli: Not Found
react: 18.1.0 = 18.1.0
react-native: 0.70.6 = 0.70.6
react-native-windows: Not Found
npmGlobalPackages:
react-native: Not Found
Steps to reproduce
Download from the repo provided below
Install the packages
And run the command: npx react-native run-android (Only configured for android)
Snack, code example, screenshot, or link to a repository
https://github.com/koen1711/react-native-ble-scala/tree/unstable
I couldn't find anything on the topic, and I am expecting no error.
I have a project I am working on that built yesterday. Today, I am getting this error 'Operator "abs" not found' as seen in the screenshot below. I am not using expo as the build system though the project does use react-native-reanaminated which keeps coming up in my search for a solution and also in this answer React Native Getting this error 'Unrecognized operator abs'.
I tried the solutions there to no avail. Any guidance would be greatly appreciated.
❯ npx react-native info
info Fetching system and libraries information...
System:
OS: macOS 10.15.7
CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU # 2.70GHz
Memory: 359.10 MB / 8.00 GB
Shell: 3.1.2 - /usr/local/bin/fish
Binaries:
Node: 14.4.0 - /var/folders/rt/7lc5vcw16459dszl8djk35fh0000gn/T/fnm-shell-146260/bin/node
Yarn: 1.22.4 - ~/Github/project5/app/node_modules/.bin/yarn
npm: 6.14.8 - /var/folders/rt/7lc5vcw16459dszl8djk35fh0000gn/T/fnm-shell-146260/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.7, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Xcode: 11.7/11E801a - /usr/bin/xcodebuild
Languages:
Java: javac 15 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
#react-native-community/cli: ^3.0.4 => 3.2.1
react: 16.13.1 => 16.13.1
react-native: 0.63.3 => 0.63.3
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
❯ qnm react-native-gesture-handler
react-native-gesture-handler
└── 1.8.0
❯ qnm react-native-reanimated
react-native-reanimated
└── 1.13.1
I was able to resolve this by running the following commands.
The first command cleans the ios build in app/ios directory.
The second command resets the simulator. You can also do it from the GUI by clicking Erase All Content and Settings.
❯ cd ios && xcodebuild clean
❯ killall "Simulator" 2> /dev/null; xcrun simctl erase all
Then you rebuild your app as normal with react-native start and open you simulator.
When I run this command from my mac
npx #react-native-community/cli doctor
I get this funny unrecognized java version :
Common
✓ Node.js
✓ yarn
✓ Watchman - Used for watching changes in the filesystem when in development mode
Android
✖ JDK
Version found: 1.8.0_242-release
Version supported: >= 8
When I execute :
react-native info
I get :
info Fetching system and libraries information...
System:
OS: macOS 10.15.5
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU # 2.20GHz
Memory: 226.40 MB / 16.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.18.2 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.5 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.3 - /Users/emmanuelharel/.gem/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 28, 30
Build Tools: 28.0.3, 29.0.2, 30.0.0
System Images: android-30 | Google Play Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.0 AI-193.6911.18.40.6514223
Xcode: 11.5/11E608c - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_242-release - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
#react-native-community/cli: Not Found
react: ~16.11.0 => 16.11.0
react-native: ~0.62.2 => 0.62.2
npmGlobalPackages:
*react-native*: Not Found
Has anyone an idea why react native cli is not able to get that java 1.8 and 8 are the "same"?
see https://github.com/react-native-community/cli/issues/1255
There is a pull request #1395 just in for this to fix it, so it might be accepted soon and make its way into a patch.
When selecting the Simulator's "Shake" gesture to bring up the Reload/Inspector/Monitor options, the "Enable Live Reload" and "Enable Hot Reloading" options are missing.
I had an old version running, along with a new instance (same code). The new instances do not show the most useful options.
react-native info
produces:
React Native Environment Info:
System:
OS: macOS 10.14.4
CPU: (4) x64 Intel(R) Core(TM) i5-4278U CPU # 2.60GHz
Memory: 84.52 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 11.4.0 - /usr/local/bin/node
Yarn: 1.12.3 - /usr/local/bin/yarn
npm: 6.5.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
Android SDK:
API Levels: 23, 25, 26, 27, 28
Build Tools: 26.0.2, 26.0.3, 27.0.3
System Images: android-26 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom
IDEs:
Android Studio: 3.2 AI-181.5540.7.32.5056338
Xcode: 10.2/10E125 - /usr/bin/xcodebuild
npmPackages:
react: ^16.8.6 => 16.8.6
react-native: ^0.56.1 => 0.56.1
npmGlobalPackages:
react-native-git-upgrade: 0.2.7
So far I have removed the iOS build directory and reset everything:
rm -rf ios/build && watchman watch-del-all && npm start -- --reset-cache
and re-ran yarn,
yarn start --reset-cache
rebooted, all to no avail.
I am using React Native 0.56.1
I've included a screen shot of an old simulator window that was left open, and a new instance, using the same code base, on the right.
If Hot Reload or Live Reload Options are missing it is due to this as mentioned in the react-native blog
When we asked the React Native community about common pain points, one of the top answers was that the “hot reloading” feature was broken. It didn’t work reliably for function components, often failed to update the screen, and wasn’t resilient to typos and mistakes.
https://facebook.github.io/react-native/blog/2019/09/18/version-0.61
Enviroment
React Native Environment Info:
System:
OS: macOS High Sierra 10.13.6
CPU: x64 Intel(R) Core(TM) i5-8259U CPU # 2.30GHz
Memory: 40.32 MB / 8.00 GB
Shell: 3.2.57 - /bin/sh
Binaries:
Node: 10.10.0
Yarn: 1.9.4
npm: 6.4.1
Watchman: 4.9.0
SDKs:
iOS SDK:
Platforms:
iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0
IDEs:
Android Studio: 3.1 AI-173.4907809
Xcode: 10.0/10A255 - /usr/bin/xcodebuild
npmPackages:
react: ^16.3.0 => 16.3.0
react-native: ^0.57.1 => 0.57.1
npmGlobalPackages:
create-react-native-app: 1.0.0
react-native-cli: 2.0.1
If i write:
sudo react-native run-ios
it says
03:43:31: Starting packager... 03:43:41: Starting simulator...
and its stucks here
and if i write firstly
Talha-MacBook-Pro:TusTTS talhasalt$ sudo react-native eject
then
sudo react-native run-ios
I think your xcode are running background on a project that can't be build successfully. Make sure you have opened error free project on xcode(the project can be anything). After doing that see the magic.I don't know why its happening but work for me.