Cocoapods installation problem in apple m1 - reactjs

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

Related

React native installation error in dependencies

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

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 installation on mac

i need some help because i recently start to work on my macbook (until my ubuntu VM) and i have some trouble with the installation.
And now when i load my old project i got this :
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: /Users/gauloix/Documents/GitHub/BuyTheWay-FRONT/src/index.js: Unexpected token (10:0)
obviously i missed something during the pkg installation or something witch brew :/
If the error was to obvious dont blame me i've just finised my formation and i'm newbie ^^'
image description here
Thanks beforehand !
This might be error of babel library .
Try this "npm install -D babel-loader#latest #babel/core#latest #babel/preset-env#latest" installation . It might helpfull.
First of all, I would suggest you to use nvm for managing different Node.JS versions. Installing it is easy:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
Once installed, you can install and use any Node.JS version with simple commands like:
# Install the latest Node.JS version
nvm install node
# Install a specific version
nvm install 6.14.4
# Use Node.JS version marked as "default"
nvm use node
# Or use some other version
nvm use node6
Once you have nvm ready, use npx to create a completely new React app and try to start it:
npx create-react-app myAppName
cd myAppName
npm start
If you don't get any errors during this process, I would suggest to simply overwrite newly created React app with your old code, excluding package.json. Before running the app with overwritten code, uninstall all packages you installed globally for the time being:
# List all globally installed packages
npm list -g -depth 0
# Use `npm uninstall` and uninstall them all:
npm uninstall whatever-globally
Finally, you will probably need to install some other dependencies (check your old package.json) manually:
npm install dep-1 dep-2 dep-3 ...
And then try to run the project with:
npm start

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

Doesn't work "npx create-react-app my-new-app --typescript"

Please help me. When I try to generate a project (creative-react-app), I get an error, you can look in the screenshot. The screen also shows the versions of node, npm and npx. I am using Linux Ubuntu 18.04.4 LTS.
Try to uninstall your nightly Node version and install the stable version of Node. In the error, it says that babel isn't compatible with your version of Node.
It also could be that you have an old version of React installed locally. So if the first fix doesn't work try
npm uninstall react

Resources