Error when installing 'react-navigation/stack' (Expo) - react-native

I am following a full-stack RN tutorial and apparently need to install #react-navigation/stack.
I've already tried running npm install followed by npm install --save react-navigation and then trying to install the wanted package again to no avail.
I find this error (which I cannot understand) weird because I was able to run npm install react-navigation/native just a few minutes ago.
Any suggestions would be helpful. Oh! And I am using Expo.

Related

Cannot find module ‘#expo/metro-config’ when trying to start the project with expo cli >= 4.8.0

I recently tried to launch my project on a new computer. I downloaded the source code from its repository and ran npm install to get all the needed packages.
However, when I run npm start or expo start:web, I get the error:
Cannot find module '#expo/metro-config'
I ran npm install #expo/metro-config and the install run without issue, but I still get the “Cannot find module '#expo/metro-config'” error.
The only post I saw regarding this error recommends editing the metro.config.js but I do not use one.
I am on SDK 42, and the project launches fine on my other computer. Any idea what is happening?
FYI, I use to perform this whole operation without any issue until now.
UPDATE:
I ran npm install -g #expo/metro-config and now I get the error Cannot find module 'resolve-from'
So it looks like maybe running npm install -g expo-cli doesn't actually install all the necessary packages? Could it be the issue?
I managed to make it "work" (get other missing packages errors down the line) by reverting to expo-cli 4.7.3. Anything from 4.8.0 and above will cause the error.
Something else is that on a fresh npm install, after running npm install -g expo-cli, if I try to create a project with expo init, I will get the error Error: Cannot find module 'kleur'. Running npm install kleur fix it, but maybe that's also a clue.

react-native-reanimated & react-navigation/drawer dependency error

I'm into a problem that I have already asked the discussions tab in the react-native-reanimated GitHub repository: this is the link in the github repo
I have cloned a react-native project and tried to install npm packages using npm install, but I have faced the error below
What I have done?
I have tried npm install --legacy-peer-deps, was not helpful
I have installed the packages from scratch, was not helpful
I have tried yarn to install packages the error was gone but the issue persisted
I have also tried configuring the flipper on the application but the app also does not
connect to the flipper
Any ideas and suggestions would be appreciated :)
This problem is going to be solved by just running npm with --legacy-peer-deps, this is going to tell the npm just don't do anything else except looking into the package-lock.json file and install the versions that you used to have in your node_modules folder.
npm install --legacy-peer-deps
I should mention that you are going to see this output while you are using npm version 7 or above.

expo install vs npm install

I'm just getting started with Expo -- but I've done RN development using the CLI. One of the first things I noticed is that I am supposed to install third party packages using expo install <package-name> so that we know the package is compatible.
However, I just noticed that even though Expo recommends React Navigation for navigation and routing, the first step in installing it is npm install #react-navigation/native. We then continue with expo install for installing Expo dependencies. Here's the instructions: https://reactnavigation.org/docs/getting-started/
I'm a bit confused here. I thought we weren't supposed to use npm install with Expo. What am I missing? Why are we using npm install for the React Navigation package and not expo install?

How can I install an older version of npm even though I already have a newer version, in order to get react native working

Trying to use react native but apparently the newest version of npm doesn't work with it. How can I install an older version. Thorough instructions would be very helpful. Thanks
Also, I am VERY new to this entire programming thing. I know some basic JavaScript an decent Python but that's about it, is I too early for me to attempt to learn react native
Try this:
First uninstall existing npm using npm uninstall npm -g command .
Then remove nodejs.
Install nodejs again.
Now, install npm using npm install -g npm#4.6.1

Cannot start ReactNativeProject

I followed the tutorial in the link here https://facebook.github.io/react-native/docs/getting-started.html#content . As it turns out, npm 5 is not supported yet. I tried installing npm 4 but, it is not working either. Stuck in the first page of the tutorial, when I run npm start, I am getting a bunch of errors too. Literally stuck, nowhere else to turn. Before voting down the question, kindly note that I am a mobile developer working with andorid and Ios having no previous knowledge about web technologies. Thanks
These are the steps I followed
npm install -g create-react-native-app
It was successfull, then,
create-react-native-app AwesomeProject
for this line, I got the following error
*******************************************************************************
ERROR: npm 5 is not supported yet
*******************************************************************************
It looks like you're using npm 5 which was recently released.
Create React Native App doesn't work with npm 5 yet, unfortunately. We
recommend using npm 4 or yarn until some bugs are resolved.
You can follow the known issues with npm 5 at:
https://github.com/npm/npm/issues/16991
*******************************************************************************
Then I ran the command
cd AwesomeProject
Afterwards I ran
npm start
for which I got the error
npm ERR! missing script: start
npm ERR! A complete log of this run can be found in:
npm ERR! /home/jayakrishnan/.npm/_logs/2017-07-25T08_13_06_277Z-debug.log
I tried using Yarn But didnt work
npm i -g npm#4.6.1 - then install create-react-native-app again and create a project.
Solution with Yarn:
First install Yarn
yarn global add create-react-native-app
cd AwesomeProject
yarn start
npm install -g npm#4 Use this to downgrade, Also use sudo with the commands, sometime it does give permission to write error and skips the installation
Try putting more information about the error so we can help, or steps to reproduce it.
One thing to try is to instead of using npm, use yarn. Install yarn with brew install yarn if you are on mac and do the same steps in the getting-started guide, except for use yarn run ios to start app in ios simulator.
I just tried with a fresh setup that this is working perfectly fine.
Reference to yarn https://yarnpkg.com/en/