I tried to use react-native-beacons-manger to use beacons in react native, but I got an error. So I try to create lower version react-native and run. But it made an error.
$ react-native init BeaconTest --version 0.59.0
$ react-native run-ios
An error looks like
Failed to load bundle(http://localhost:801/index.bundle?platform=ios&dev=true&minify=false with error:(Could not connect to development server)
my package.json file
{
"name": "BeaconTest",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.8.3",
"react-native": "0.59.0"
},
"devDependencies": {
"#babel/core": "^7.7.2",
"#babel/runtime": "^7.7.2",
"babel-jest": "^24.9.0",
"jest": "^24.9.0",
"metro-react-native-babel-preset": "^0.57.0",
"react-test-renderer": "16.8.3"
},
"jest": {
"preset": "react-native"
}
}
I also tried
$ react-native init Test
$ npm install react-native#0.59.0
but it also made some errors
please let me know how to create low version react-native so that I can use beacon package (react-native-beacons-managers)
Related
I am a newbie with react-native.
I am trying to add expo icons, and when the project is running on the device I get this error:
Screenshot with logs
{
"name": "TrackYourFitness",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"expo": "^36.0.2",
"react": "16.9.0",
"react-native": "0.61.5"
},
"devDependencies": {
"#babel/core": "^7.8.3",
"#babel/runtime": "^7.8.3",
"#react-native-community/eslint-config": "^0.0.6",
"babel-eslint": "^10.0.3",
"babel-jest": "^25.1.0",
"eslint": "^6.8.0",
"eslint-plugin-flowtype": "^4.6.0",
"jest": "^25.1.0",
"metro-react-native-babel-preset": "^0.58.0",
"react-test-renderer": "16.9.0"
},
"jest": {
"preset": "react-native"
}
}
I tried yarn react-native link, but it didn't work.
How can I fix it? Thanks in advance!
According to your error message, you are trying to call the method downloadAsync from the package expo-file-system.
This package is missing in your package.json.
To install it: run the following command:
expo install expo-file-system
But I don't think this is related to your problem, because you're talking about icons. Icons package is already included in Expo, so it will work.
For reference: https://docs.expo.io/versions/latest/guides/icons/
run
npm install react-native-unimodules
npx pod-install //for ios
made changes in your android file based on IOS and Android
see link
https://docs.expo.io/bare/installing-unimodules/
restart react-native again...
npm start
npx react-native run-android
Happy Coding!!!
I'm trying to use react-native init ABC --version 0.57.0 and it has an error. Tried to use other formats of init, but still doesn't work.
If anybody needs to install 0.59.x do this:
mkdir rn59cli
cd rn59cli
npm init -f
npm install react-native-cli
node_modules/.bin/react-native init Rn59SampleApp --version 0.59.10
Using yarn v1.21.1
Installing react-native#0.59.10...
yarn add v1.21.1
warning ../../package.json: No license field
info No lockfile found.
[1/4] 🔍 Resolving packages...
info Direct dependencies
└─ react-native#0.59.10
$ cat Rn59SampleApp/package.json
{
"name": "Rn59SampleApp",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.8.3",
"react-native": "0.59.10"
},
"devDependencies": {
"#babel/core": "^7.8.4",
"#babel/runtime": "^7.8.4",
"babel-jest": "^25.1.0",
"jest": "^25.1.0",
"metro-react-native-babel-preset": "^0.58.0",
"react-test-renderer": "16.8.3"
},
"jest": {
"preset": "react-native"
}
}
Try re-installing react-native CLI
I am trying to create new project with react-native cli, but when I create a new project I am receiving the following error message:
react-native > create-react-class > fbjs > core-js#1.2.7: core-js#<2.6.8 is no longer maintained. Please, upgrade to core-js#3 or at least to actual version of core-js#2.
Listed below is the contents of my package.json file:
{
"name": "EmojiDictRN",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.8.3",
"react-native": "0.59.8"
},
"devDependencies": {
"#babel/core": "^7.4.5",
"#babel/runtime": "^7.4.5",
"babel-jest": "^24.8.0",
"jest": "^24.8.0",
"metro-react-native-babel-preset": "^0.54.1",
"react-test-renderer": "16.8.3"
},
"jest": {
"preset": "react-native"
}
}
To see the full output from my terminal please click here. Any ideas on how to resolve this warning message?
Any help would be greatly appreciated!
Download and save the version of the core-js module which is requested within your warning message:
npm install --save core-js#^3
This will update the core-js dependency for your react-native project to use version ^3.x.x which is still being actively maintained.
Hopefully that helps!
The problem comes soon after react-native init tech_stack1, react-native run-iso command and the last Xcode update (9.1).
It alternate with "No bundle URL present".
This my package.json
"name": "tech_stack1",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.0.0",
"react-native": "0.50.0"
},
"devDependencies": {
"babel-jest": "21.2.0",
"babel-preset-react-native": "4.0.0",
"jest": "21.2.1",
"react-test-renderer": "16.0.0"
},
"jest": {
"preset": "react-native"
}
After some upgrades to #latest versions of react-native, redux and react-redux I was able to get rid of this error, also by performing a react-native start command in a new terminal window ( to get rid of no bundle URL present).
hello everyone i am new to react native and started learning the react from last week.
But now i stuck on problem that react-native-vector-icons doesn't install properly,i don't know why its happen.i am not getting what is the exact issue
here is my package.json
{
"name": "ephotobook",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.0.0-alpha.12",
"react-native": "0.46.3",
"react-native-icons": "^0.7.1",
"react-native-material-ui": "^1.12.0"
},
"devDependencies": {
"babel-jest": "20.0.3",
"babel-preset-react-native": "2.1.0",
"jest": "20.0.4",
"react-test-renderer": "16.0.0-alpha.12"
},
"jest": {
"preset": "react-native"
}
}
when i run npm install react-native-vector-icons
i get the following error
`-- UNMET PEER DEPENDENCY react-native-vector-icons#^4.0.0
npm WARN react-native-material-ui#1.12.0 requires a peer of react-native-vector-
icons#^4.0.0 but none was installed.
please help me to install both material ui and vecctor icons
You can update version of react-native-vector-icon in your package.json like :
"react-native-vector-icons": "^4.0.0",
I hope this is can help you.
As mentioned in warning you need to add vector icons to package.json before installing material ui.
"react-native-vector-icons": "^4.0.0"