I'm trying to create a new react native app with react navigation.
I did the following:
1.) create-react-native-app myAppName
2.) cd myAppName/
3.) npm install --save react-navigation
4.) Expecting successful installation of react-navigation but instead i get:
C:\Users\Maima\Documents\GitHub\React\test>npm install --save react-navigation
npm WARN rm not removing C:\Users\Maima\Documents\GitHub\React\test\node_modules
\.bin\jest.cmd as it wasn't installed by C:\Users\Maima\Documents\GitHub\React\t
est\node_modules\jest
npm WARN rm not removing C:\Users\Maima\Documents\GitHub\React\test\node_modules
\.bin\jest as it wasn't installed by C:\Users\Maima\Documents\GitHub\React\test\
node_modules\jest
npm WARN rm not removing C:\Users\Maima\Documents\GitHub\React\test\node_modules
\.bin\rimraf.cmd as it wasn't installed by C:\Users\Maima\Documents\GitHub\React
\test\node_modules\rimraf
npm WARN rm not removing C:\Users\Maima\Documents\GitHub\React\test\node_modules
\.bin\rimraf as it wasn't installed by C:\Users\Maima\Documents\GitHub\React\tes
t\node_modules\rimraf
npm WARN rm not removing C:\Users\Maima\Documents\GitHub\React\test\node_modules
\.bin\uuid.cmd as it wasn't installed by C:\Users\Maima\Documents\GitHub\React\t
est\node_modules\uuid
npm WARN rm not removing C:\Users\Maima\Documents\GitHub\React\test\node_modules
\.bin\uuid as it wasn't installed by C:\Users\Maima\Documents\GitHub\React\test\
node_modules\uuid
npm WARN rm not removing C:\Users\Maima\Documents\GitHub\React\test\node_modules
\.bin\semver.cmd as it wasn't installed by C:\Users\Maima\Documents\GitHub\React
\test\node_modules\semver
npm WARN rm not removing C:\Users\Maima\Documents\GitHub\React\test\node_modules
\.bin\semver as it wasn't installed by C:\Users\Maima\Documents\GitHub\React\tes
t\node_modules\semver
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN react-navigation#1.0.0-beta.23 requires a peer of react#* but none is i
nstalled. You must install peer dependencies yourself.
npm WARN react-navigation#1.0.0-beta.23 requires a peer of react-native#* but no
ne is installed. You must install peer dependencies yourself.
npm WARN react-native-tab-view#0.0.74 requires a peer of react#* but none is ins
talled. You must install peer dependencies yourself.
npm WARN react-native-tab-view#0.0.74 requires a peer of react-native#* but none
is installed. You must install peer dependencies yourself.
npm WARN react-native-drawer-layout-polyfill#1.3.2 requires a peer of react-nati
ve#* but none is installed. You must install peer dependencies yourself.
npm WARN react-native-drawer-layout#1.3.2 requires a peer of react#* but none is
installed. You must install peer dependencies yourself.
npm WARN react-native-drawer-layout#1.3.2 requires a peer of react-native#* but
none is installed. You must install peer dependencies yourself.
+ react-navigation#1.0.0-beta.23
added 8 packages, removed 973 packages and updated 20 packages in 259.667s
Please Help, Cant npm start my React Native App.
It can be solved by running a npm install command again and reinstall the npm install --save react-navigation command.
I cant comment because I dont have the points, so heres a tentative answer with the info at the moment:
I had similar issue when running Expo on Windows. to solve I had to close XDE and reinstall.
if that's not enough, delete the "node_modules" folder and run "npm install".
They aren't errors, just warnings telling you that some peer dependencies that navigation relies on aren't installed. Based on your commands, you need to run npm install or yarn install to install all the packages. Creating the app with create-react-native app give you a list of packages but you have to actually install them with npm install. If something funky happens, do what #vbandrade suggested and hose your node_modules and package.lock, then do a fresh npm install
The same error appeared when I tried to run npm install --save react-navigation. Turns out I needed to run npm install prior to npm install --save react-navigation.
Followed the steps but got error with npm install. I am also using Expo (as mentioned by #vbandrade) and there are also problems with that. First of all, i think react-navigation is changing a lot. After trying a lot (before applying the solution in the accepted answer), i installed react-navigation and its dependencies multiple times and it worked at one time when i first ran;
npm install react-navigation
then
npm install #react-navigation/native
(which doesn't make too sense for me as that gets auto installed with react-navigation). Then i ran;
npm install react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context #react-native-community/masked-view
for installing dependencies and it worked. Honestly i didn't understood anything that how it worked. So for the sake of learning i installed the project and reinstalled it with expo and after that nothing worked. So i applied #vbandrade's answer but it was giving some more errors after i ran npm install.
To get rid of these errors, i found another solution (from stackoverflow). Here is that solution.First of all delete node_modules folder and package-lock.json file and close your editor or any other file where your project is open (because node doesn't install some packages if the project is open).
Then,
First run this command;
npm cache clean --force
Then,
npm install
And then;
npm install react-navigation
And at last install the dependencies;
npm install react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context #react-native-community/masked-view
Run your project;
If using expo;
expo start
Errors must be gone now.
If you are running your expo server, stop the server and continue npm install --save react-navigation . It worked for me.
Related
Everything in my prooject works fine and I do not get any errors with android studio. I get an output and so on. As soon I install firebase, I do get some errors, but at face value it looks like the installation went well. At most I get the below. Are these significant issues?
npm WARN rm not removing C:\Users\ferre\react\auth\node_modules\.bin\uuid.cmd as it wasn't installed by C:\Users\ferre\react\auth\node_modules\uuid
npm WARN rm not removing C:\Users\ferre\react\auth\node_modules\.bin\uuid as it wasn't installed by C:\Users\ferre\react\auth\node_modules\uuid
npm WARN rm not removing C:\Users\ferre\react\auth\node_modules\.bin\jsesc.cmd as it wasn't installed by C:\Users\ferre\react\auth\node_modules\jsesc
npm WARN rm not removing C:\Users\ferre\react\auth\node_modules\.bin\jsesc as it wasn't installed by C:\Users\ferre\react\auth\node_modules\jsesc
npm WARN rm not removing C:\Users\ferre\react\auth\node_modules\.bin\esparse.cmd as it wasn't installed by C:\Users\ferre\react\auth\node_modules\esprima
npm WARN rm not removing C:\Users\ferre\react\auth\node_modules\.bin\esvalidate.cmd as it wasn't installed by C:\Users\ferre\react\auth\node_modules\esprima
npm WARN rm not removing C:\Users\ferre\react\auth\node_modules\.bin\esparse as it wasn't installed by C:\Users\ferre\react\auth\node_modules\esprima
npm WARN rm not removing C:\Users\ferre\react\auth\node_modules\.bin\esvalidate as it wasn't installed by C:\Users\ferre\react\auth\node_modules\esprima
I then cannot use react-native run-android anymore and says the command is unrecognized. What am I missing?
Found the solution.
1) I was adding firebase with npm install rather than yarn add. Apparently this is a common problem. However, it may not be common that the version of firebase you install can cause problems. The version that worked for me was firebase#5.0.3
2) Another problem was that as a result of this installation, certain files in node_modules were being shaken up. Solved this by brute force copying and pasting from a fresh react-native project.
3) Lastly, one of my filepaths in my project was messed up.
Sorry for a rather insignificant question, but I hope this answer gives significant results to anyone who needs it.
I have a react-native project where I install modules using
npm install some-module -save
package.json includes react-native-cli
Now, every time I do this the command react-native run-android is not available anymore. I have to run
yarn add react-native-cli
in order for it to be available again. Also, the gradle file of some modules get out of sync when I do this which means running Android Studio and updating these.
I find this very confusing. Earlier in the project, I was only using npm and had no problems.
i think you can try this
npm install -g <package> --save
Problem
I'm trying to install react-native-maps by Airbnb in my project. Installation instructions:
airbnb/react-native-maps/installation
When I run the following command in cmd: npm install react-native-maps --save
This is what I get:
`-- react-native-maps#0.14.0
npm WARN react-native-maps#0.14.0 requires a peer of react#>=15.4.0 but none was installed.
Ignoring this if I proceed with further installation, and run the following command: react-native link react-native-maps
This is what I get:
Scanning 561 folders for symlinks in C:\RNProjects\Mapp\node_modules (39ms)
rnpm-install info Linking react-native-maps ios dependency
rnpm-install info iOS module react-native-maps has been successfully linked
^As we can see, only iOS related maps modules get installed. On checking the project directory, I was able to validate that no android related module was installed.
Troubleshooting
Here's the list of thing I tried to resolve the issue, but none of them worked.
Tried installing npm install react#15.4.0 --save
Got these warnings:
npm WARN react-native#0.43.3 requires a peer of react#16.0.0-alpha.6 but none was installed.
npm WARN react-test-renderer#16.0.0-alpha.6 requires a peer of react#^16.0.0-alpha.6 but none was installed.
So, in order to resolve this, I tried installing react#16.0.0-alpha.6 with: npm install react#16.0.0-alpha.6.
I got the same message again:
npm WARN react-native-maps#0.14.0 requires a peer of react#>=15.4.0 but none was installed.
Tried updating react-native npm update react-native.
Still getting the same warning message.
Tried installing the latest version of npm: npm install npm#latest -g.
Didn't work.
Additional Information
react-native: 0.43.3
react-native-cli: 2.0.1
Platform: Android
Development Operating System: Windows 10 OS
Here's how I was able to solve this (chronological order):
Deleted node_module directory from the project
npm cache clean
Modified package.json with: "react":"~15.4.1"; "react-native":"0.42.3"; "react-test-renderer":"15.4.1"
npm install all module
npm install
npm i react-native-maps#0.12.5 --S
react-native link react-native-maps
Once I do this, it's successfully able to link the android and ios react-native-modules to the project.
Note: Before running the react-native run-android command,
Run: cd android && gradlew clean && cd .. && react-native run-android.
This will clean the gradle before running and help in avoiding any errors.
You can try:
delete node_module, npm cache clean;
modify package.json
"react": "~15.4.1","react-native": "0.42.3","react-test-renderer": "~15.4.1",
npm install all module;
done ;)
Here is how i was able to solve this same issue:
I deleted the node_module folder (You can verify npm cache: npm cache verify)
I actually changed the package.json file to the following:
"react": "~15.4.1","react-native": "0.42.3","react-test-renderer": "~15.4.1"
But that triggered other error on my side; So i put them back to their initial
values:
a. "react": "17.0.1",
b. "react-native": "0.64.0",
c. "react-test-renderer": "17.0.1"
npm install all module
npm install
npm audit fix --force
npm i react-native-maps#0.12.5 --S
react-native link react-native-maps
At this point I opened 2 terminals:
a. Terminal 1: react-native start
b. Terminal 2: react-native run-android or yarn android
Before reading and following the tutorial in NPM I installed the react-native-cli globally and it worked just fine
But in the tutorial it asks you to install sinopia
https://www.npmjs.com/package/react-native-cli
Then it gives you these instructions
react-native$ npm set registry http://localhost:4873/
react-native$ npm adduser --registry http://localhost:4873/
# Check that it worked:
react-native$ npm config list
react-native$ npm unpublish --force
react-native$ npm publish
react-native$ cd react-native-cli/
react-native-cli$ npm unpublish --force
react-native-cli$ npm publish
But the unpublish part gave me an error. the same for the 'publish' aprt.
(By the way, publish what?!)
Then it says to uninstall react-native-cli
npm uninstall -g react-native-cli
After that I couldn't reinstall react-native-cli.
It says the package is not available.
npm ERR! 404 no such package available : react-native-cli
npm ERR! 404
npm ERR! 404 'react-native-cli' is not in the npm registry.
What is this?! How can I fix it?
#edit
By the way, I don't understand why, in the Get Started tutorial it doesn't tell us how to install the react-native-cli nor gives us a link. It just states:
The React Native CLI #
Node.js comes with npm, which lets you install the React Native command line interface.
#edit2
I just managed to install react-native-cli by removing the 'registry' entry from npm config, installing it and adding Sinopia again.
I thought Sinopia worked as a proxy. If it is not found in local repository, it looks for it in NPMJS...
I even tried to install other things and I could (wdio, nodemon), I just got an error with react-native-cli.
It seems that something is wrong.
Seems like you on Windows
I don't think you need sinopia.
Tutorials was little improved on master branch of the docs: http://facebook.github.io/react-native/releases/next/docs/getting-started.html
In short:
Install node.js
Install react-native-cli: npm install react-native-cli
Install & setup Android SDK
Create & run project
react-native init AwesomeProject
cd AwesomeProject
react-native start
react-native run-android
while installing ionic npm install -g ionic getting error.
Have tried : -
npm cache clean 2. run the cli by administrator 3. restarted the system but error remain same.
Badly stocked.
I was having same problem on Windows 8 (64 bit)
Solution:
Don't forget to install other dependencies before installing ionic http://ionicframework.com/docs/guide/installation.html
1) Uninstall Node from Control Panel
2) Restart PC
3) Download (MSI Installer) older version of Node from http://nodejs.org/dist/v0.10.38/ or 64bit http://nodejs.org/dist/v0.10.38/x64/
4) Install Node version 0.10.38
5) npm install -g cordova
6) npm install -g ionic
Done!
it is not nessesary to uninstall node...
just remove the old npm ionic folder
...AppData\Roaming\npm\node_modules\ionic
and try again
npm install -g ionic
For me the answers provided did not work. I got around this problem by installing cordova and ionic at the same time.
npm install -g cordova ionic
If proxy is preventing this, other things to try are setting the proxy, making http request and disabling strict-ssl. An example of setting proxy is
npm config set proxy=http://username:password#domain:port/
To make http request only change the config
npm config set registry=http://registry.npmjs.org/
To disable strict-ssl
npm config set strict-ssl=false
Also, if you wanted to view the default list of configs type
npm config ls -l
This will also show what configurations have been overridden.
Uninstall Node.js and install freshly after done installation run the following command
npm install -g ionic cordova
That's it.