React native installation error in dependencies - reactjs

enter image description hereFor mac os
Your RubyGems version (3.0.3.1) has a bug that prevents required_ruby_version from working for Bundle
Your RubyGems version (3.0.3.1) has a bug that prevents required_ruby_version from working for Bundle

try to install ruby 2.7.6
rvm install "ruby-2.7.6"
or bundle install from the root of your project

Related

Typescript version in VScode

I have a CRA app in VSCode.
My global TS version is:
My project TS version is (package.json):
VSCode uses the latest:
Now, when I try to add a 4.0 TS feature, the terminal shows a compilation error:
I tried to change the package.json TS version to latest and ran npm install but it didn't help.
My Questions are:
Why doesn't it compile?
Which TS version is used for PROBLEMS pane and which for terminal? I would expect the same error in both locations.
Thanks in advance!
When you run tsc -v in the terminal, you are calling a globally installed Typescript package which is showing you have version 4.8.4 installed.
You can verify this by running npm list -g --depth 0 which will list all the global packages you have installed, along with their versions.
However, when using npm scripts (e.g in CRA npm run build) the Typescript package inside your node_modules folder is called. Since this version of Typescript is 3.x the compilation will fail. By changing VSCode to use the workspace version, the same error will be shown.
Upgrading the version inside your package.json to the latest should fix this error. To be sure the correct version is being used, try using an npm script to list the version by including this vers script in your package.json
"scripts": {
"...": "your other scripts",
"vers": "tsc -v"
}
then run npm run vers in your terminal.
TLDR:
Q1.
The Typescript version used when running the CRA build script (3.x)
is targeted which will fail when using 4.x syntax.
Q2.
The problems pane in VSCode uses the VSCode Typescript version
(depends how up to date your VSCode is) unless manually switched to
use the workspace version (node_modules version).
The terminal will target your globally installed version.
NPM scripts will target the version inside your node_modules folder.

Cocoapods installation problem in apple m1

This is the screenshot of the current situation. Its a Brand new Apple M1 MacBook. react is working fine but React-native is not getting installed properly. Tried various solutions but no luck.
In my case I was able to do it natively.
Try this on native terminal.
brew install ruby #update to latest version
sudo gem install ffi
sudo gem install cocoapods
sudo gem install ethon #update to latest version
Note: This worked for me. Can't guarantee the same would happen for you.
run the following commands in the ios directory of your React Native project
sudo arch -x86_64 gem install ffi
arch -x86_64 pod install
refer to this
Running CocoaPods on Apple Silicon (M1)
it is because of m1's architecture that you need to run different commands from those that are mentioned in the official docs of React Native

Can't run Gatsby develop on existing project on Mac M1

When running Gatsby develop on a project, it doesn't run. This is everything I get: (not very verbose)
my-project [master●] % gatsby develop
success open and validate gatsby-configs - 0.052s
⠋ load plugins
[1] 77411 killed gatsby develop
For context, the project was developed on an older Mac and runs without problems there (or on two other peoples' non-M1 macs). Installing and running a new Gatsby site is seamless.
Previously I had trouble getting this project to run, when running npm install, which I was able to fix by reinstalling brew vips and xcode-select.
But this doesn't throw an error... so I have no idea what's going on.
I tried installing vscode insiders, but no luck there.
Any clues as to what's happening?
same issue here.
I ended up re-installing brew and that made the trick.
The flow which i tried got worked for me, also i had posted you the configuration which i had previously.
brew reinstall vips
xcode-select --install
brew install gcc
brew reinstall vips
brew info vips
npm i
System Informations:
Gatsby CLI version: 4.0.0
Gatsby version: 3.14.6
Node version: v14.18.0
NPM version: 6.14.15

React-native-reanimated: Unable to resolve "./useValue"

I am trying to build a react native app. I have caught an error on the terminal saying
Unable to resolve "./useValue" from "node_modules\react-native-reanimated\src\Animated.js"
I reinstalled react-native-reanimated to the expected version range.
`Some of your project's dependencies are not compatible with currently installed expo package version:
react-native-reanimated - expected version range: ~1.9.0 - actual version installed: ^1.10.1
Your project may not work correctly until you install the correct versions of the packages. To install the correct versions of these packages, please run: expo install [package-name ...]`
Thus, I run the code as follow: npm install react-native-reanimated#1.9.0, but still run into the error code.
I could realy use some help on this.
try uninstalling the package ==> close ide (all instances) ==> open the ide ==> install the package again ==> run "expo start -c"
Only do this:
expo start --clear
From Expo Documentation at Expo Start command.
--clear, -c | Clear the React Native Packager cache.

How do i downgrade expo and install a specific package?

Some of your project's dependencies are not compatible with currently installed expo package version:
- #react-native-community/netinfo - expected version range: 5.5.1 - actual version installed: ^5.8.0
Your project may not work correctly until you install the correct versions of the packages.
To install the correct versions of these packages, please run: expo install [package-name ...]
Im getting this above warning. is there any cli command to do install specific expo package? if yes then please provide it. Thanks.
Into your package.json file, update the version of #react-native-community/netinfo to the right one (5.5.1), and make a npm install again.
You can also provide the version by using the cli command :
npm i #react-native-community/netinfo#5.5.1

Resources