When native-based is installed, expo prints the following error: "Error: React native is not installed. Please run `npm install` in your project directory."
See original GitHub issueSummary
- I have created a new expo project. When I install native-base using npm and I am trying to reopen the project in expo, I get the following message:
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.
Environment
Running expo on windows 10
package.json
{
"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"
}
}
Expected behaviour
To open the project in expo without errors
Actual behaviour
See in summary
above
In addition, when I run npm install native-based --save
, I get the following messages:
npm WARN deprecated istanbul-lib-hook@1.2.1: 1.2.0 should have been a major version bump
> native-base@2.7.2 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 jest-expo@29.0.0 requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN react-navigation@2.9.3 requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN react-navigation@2.9.3 requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN native-base@2.7.2 requires a peer of react@>=16.4.1 but none is installed. You must install peer dependencies yourself.
npm WARN native-base@2.7.2 requires a peer of react-native@>=0.56.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-keyboard-aware-scroll-view@0.5.0 requires a peer of react-native@>=0.48.4 but none is installed. You must install peer dependencies yourself.
npm WARN jest-react-native@18.0.0 requires a peer of react-native@>=0.38.0 but none is installed. You must install peer dependencies yourself.
npm WARN native-base-shoutem-theme@0.2.2 requires a peer of react@>=16.0.0-alpha.3 but none is installed. You must install peer dependencies yourself.
npm WARN native-base-shoutem-theme@0.2.2 requires a peer of react-native@>=0.43.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-iphone-x-helper@1.0.3 requires a peer of react-native@>=0.42.0 but none is installed. You must install peer dependencies yourself.
npm WARN expo-camera@1.0.0 requires a peer of react-native@^0.55.4 but none is installed. You must install peer dependencies yourself.
npm WARN expo-gl@1.0.0 requires a peer of react-native@^0.55.4 but none is installed. You must install peer dependencies yourself.
npm WARN lottie-react-native@2.5.0 requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN lottie-react-native@2.5.0 requires a peer of react-native@>=0.46 but none is installed. You must install peer dependencies yourself.
npm WARN expo-react-native-adapter@1.0.0 requires a peer of react@^16.3.1 but none is installed. You must install peer dependencies yourself.
npm WARN expo-react-native-adapter@1.0.0 requires a peer of react-native@^0.55.4 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-branch@2.2.5 requires a peer of react-native@>=0.40.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-gesture-handler@1.0.6 requires a peer of react@> 15.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-gesture-handler@1.0.6 requires a peer of react-native@>= 0.50.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-maps@0.21.0 requires a peer of react@^16.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-maps@0.21.0 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 react-native-svg@6.2.2 requires a peer of react-native@>=0.50.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-svg@6.2.2 requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN expo-sms@1.0.0 requires a peer of react-native@^0.55.4 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-reanimated@1.0.0-alpha.3 requires a peer of react@16.0.0-alpha.6 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-reanimated@1.0.0-alpha.3 requires a peer of react-native@^0.44.1 but none is installed. You must install peer dependencies yourself.
npm WARN expo-core@1.0.1 requires a peer of expo-react-native-adapter@^1.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN expo-core@1.0.1 requires a peer of expo-react-native-adapter@^1.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN expo-core@1.0.1 requires a peer of expo-react-native-adapter@^1.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN expo-core@1.0.1 requires a peer of expo-react-native-adapter@^1.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN expo-core@1.0.1 requires a peer of expo-react-native-adapter@^1.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN expo-core@1.0.1 requires a peer of expo-react-native-adapter@^1.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN expo-core@1.0.1 requires a peer of expo-react-native-adapter@^1.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-safe-module@1.2.0 requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN react-test-renderer@16.4.1 requires a peer of react@^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-safe-area-view@0.8.0 requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN react-native-safe-area-view@0.8.0 requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN create-react-context@0.2.2 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 react-navigation-deprecated-tab-navigator@1.3.0 requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN react-navigation-drawer@0.4.3 requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN react-navigation-drawer@0.4.3 requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN react-navigation-tabs@0.5.1 requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN react-navigation-tabs@0.5.1 requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN react-native-tab-view@1.0.2 requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN react-native-tab-view@1.0.2 requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN react-native-safe-area-view@0.7.0 requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN react-native-safe-area-view@0.7.0 requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN react-native-tab-view@0.0.77 requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN react-native-tab-view@0.0.77 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-native@* 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.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ native-base@2.7.2
added 110 packages from 74 contributors, removed 393 packages, updated 618 packages and audited 26831 packages in 80.881s
Steps to reproduce should include code snippet and screenshot. Include code snippet in preformatted mode (code
)
- Create a new expo project
- install native-base using
npm install --save
See also in Any other additional info
below. Using yarn doesnβt solve the problem.
Is the bug present in both iOS and Android or in any one of them?
Errors received before running the code
Any other additional info
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.
Issue Analytics
- State:
- Created 5 years ago
- Comments:17 (6 by maintainers)
Top Results From Across the Web
Error: React native is not installed. Please run `npm install` in ...
When I Installed the react-navigation package that error occurred for me. I've fixed my issue. Delete node_modules, package-lock.json; run ...
Read more >Install in Expo project - NativeBase
Expo helps you to create universal (iOS, Android and Web) React Native apps with no build configuration. New Project. Existing Project. Create a...
Read more >Images - React Native
React Native provides a unified way of managing images and other media assets in your Android and iOS apps. To add a static...
Read more >FileSystem - Expo Documentation
Expo is an open-source platform for making universal native apps for Android, iOS, and the web with JavaScript and React.
Read more >React Native Development Process | Taro ζζ‘£ - GitHub Pages
This article mainly explains the Taro React Native end environment installation - development - debugging - packaging - release principles and processes,Β ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Did you try clearing node_modules, lock files and install again?
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.