Error: React native is not installed. Please run `npm install` in your project directory.
Running npm install doesn't solve the problem.
Using yarn instead of npm doesn't solve the problem.
Running expo on windows 10
{
"name": "my-new-project",
"main": "node_modules/expo/AppEntry.js",
"private": true,
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"eject": "expo eject",
"test": "node ./node_modules/jest/bin/jest.js --watchAll"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"@expo/samples": "2.1.1",
"expo": "29.0.0",
"native-base": "^2.7.2",
"react": "16.3.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-29.0.0.tar.gz",
"react-navigation": "^2.9.3"
},
"devDependencies": {
"jest-expo": "29.0.0"
}
}
To open the project in expo without errors
See in summary above
In addition, when I run npm install native-based --save, I get the following messages:
npm WARN deprecated [email protected]: 1.2.0 should have been a major version bump
> [email protected] postinstall C:\esites-native\temp\node_modules\native-base
> node addEjectScript.js
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ NativeBase 2.0 has been succesfully installed! โ
โ Run `node node_modules/native-base/ejectTheme.js` to copy over theme config and variables. โ
โ Head over to the docs for detailed information on how to make changes to the theme. โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@>=16.4.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-native@>=0.56.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-native@>=0.48.4 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-native@>=0.38.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@>=16.0.0-alpha.3 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-native@>=0.43.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-native@>=0.42.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-native@^0.55.4 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-native@^0.55.4 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-native@>=0.46 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@^16.3.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-native@^0.55.4 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-native@>=0.40.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@> 15.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-native@>= 0.50.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@^16.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-native@^0.51 || ^0.52 || ^0.53 || ^0.54 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-native@>=0.50.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-native@^0.55.4 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-native@^0.44.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of expo-react-native-adapter@^1.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of expo-react-native-adapter@^1.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of expo-react-native-adapter@^1.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of expo-react-native-adapter@^1.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of expo-react-native-adapter@^1.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of expo-react-native-adapter@^1.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of expo-react-native-adapter@^1.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@^0.14.0 || ^15.0.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ [email protected]
added 110 packages from 74 contributors, removed 393 packages, updated 618 packages and audited 26831 packages in 80.881s
code)npm install --saveSee also in Any other additional info below. Using yarn doesn't solve the problem.
Errors received before running the code
Using yarn instead of npm, I get the following messages:
Warning: 'react' peer dependency missing. Run `npm ls` in C:\esites-native\temp to see full warning.
Warning: 'react-native' peer dependency missing. Run `npm ls` in C:\esites-native\temp to see full warning.
If there is an issue running your project, please run `npm install` in C:\esites-native\temp and restart.
@rahamin1 I guess the issue is when React Native version is specified in this format, "react-native": "https://github.com/expo/react-native/archive/sdk-29.0.0.tar.gz"
@SupriyaKalghatgi Thanks, but this is expo's default... Shouldn't native-base work with expo as is?
This was never an issue with expo before
But there is a problem now... When posting this, I hoped that native-base people would like to fix it, since I am probably not the only one who wants to use expo with native.
Unless you have another suggestion on how to solve this, without making changes in native-base...
Did you try clearing node_modules, lock files and install again?
Yes, I did.
Did that help?
No, it did not. I also deleted node_modules and lock files and tried with yarn install. Didn't work either. It is very easy to try, no need to run any code, just to create an expo app with latest version (I chose the 'new app with tab navigation), then install native-base, close the project and open it again. You will see the error.
I chose new app with blank template, installed NativeBase with npm - failed
Cleared node_modules, lock files, installed again - worked
I did the same and I still get the same error. Maybe we have different expo XDE versions...
My version is 2.24.4, on Windows 10.
I dd'nt go with XDE way
I go with cli
You are right. with the CLI it works as you wrote.
I should have said this earlier: I appreciate very much the prompt replies! It will help me use native-base.
Thank you! ๐
I have had same issue about my project which is established via expo cli.
What I do is just npm install under the project directory and the error gone.
I deleted node_modules , then run yarn to re-install , and it work
Hello, I'm having an issue somewhat related. This is the error Log...
[22:46:02] Error: node_modules directory is missing. Please run npm install in your project directory.
[22:46:02] Couldn't start project. Please fix the errors and restart the project
I have types in npm install. It doesn't seem like it is actually installing the files I need
please help me. react native is not installed .....
It worked for me @kingasawa!
Most helpful comment
Did you try clearing node_modules, lock files and install again?