Problem with expo, util couldnt be found within the project - reactjs

Error output
got error and couldnt get it fixed idk whats problem last thing i remember was installing latest version of npm, after that rolled back and installed everything with old package.json but cant get this fixed. this is my package.json
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"#brainsbeards/react-native-animated-code-input": "^1.0.1",
"#expo-google-fonts/inter": "^0.2.0",
"#react-native-async-storage/async-storage": "~1.15.0",
"#react-native-community/slider": "^3.0.3",
"#react-navigation/bottom-tabs": "^6.0.1",
"#react-navigation/native": "^6.0.1",
"#react-navigation/stack": "^6.0.1",
"axios": "^0.21.1",
"expo": "~42.0.1",
"expo-app-loading": "^1.1.2",
"expo-av": "^9.2.3",
"expo-blur": "^9.0.3",
"expo-clipboard": "^1.1.0",
"expo-font": "~9.2.1",
"expo-status-bar": "~1.0.4",
"jwt-decode": "^3.1.2",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-42.0.0.tar.gz",
"react-native-easy-grid": "^0.2.2",
"react-native-gesture-handler": "^1.10.3",
"react-native-render-html": "^6.0.5",
"react-native-toast-message": "^1.4.9",
"react-native-web": "^0.17.1",
"react-native-webview": "^11.6.6",
"react-query": "^3.19.2",
"zustand": "^3.5.7"
},
"devDependencies": {
"#babel/core": "^7.9.0"
},
"private": true
}

I had similar issue. Was able to remedy my situation but installing the util package.
https://www.npmjs.com/package/util

Related

Native Module cannot be null when using react-native-purchases

Trying to run an expo react native project w/ revenue cat integration. Whenever I had the react-native-pruchases library downloaded though, I continue to get this error.
Invariant Violation: Native module cannot be null
I downloaded the library by running npm install react-native-purchases --save, I didn't do any of the additional iOS setup the docs outlined. I've been going crazy over this so some help is appreciated.
package.json
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject",
"test": "jest"
},
"dependencies": {
"#react-native-community/datetimepicker": "4.0.0",
"#react-native-community/slider": "4.1.12",
"#react-navigation/bottom-tabs": "^6.2.0",
"#react-navigation/native-stack": "^6.4.0",
"dotenv": "^16.0.0",
"expo": "~44.0.0",
"expo-av": "~10.2.0",
"expo-linear-gradient": "~11.0.3",
"expo-status-bar": "~1.2.0",
"firebase": "^9.6.5",
"jest": "26.6.3",
"jest-expo": "^44.0.1",
"react": "17.0.1",
"react-dom": "17.0.1",
"react-native": "0.64.3",
"react-native-circular-progress": "^1.3.7",
"react-native-countdown-circle-timer": "^3.0.9",
"react-native-modal": "^13.0.1",
"react-native-purchases": "^4.6.0",
"react-native-safe-area-context": "3.3.2",
"react-native-screens": "~3.10.1",
"react-native-web": "0.17.1",
"uuid": "^3.4.0",
"victory-native": "^36.3.0"
},
"devDependencies": {
"#babel/core": "^7.12.9",
"#types/jest": "^27.4.0",
"#types/react": "~17.0.21",
"#types/react-native": "~0.64.12",
"react-test-renderer": "^17.0.2",
"typescript": "~4.3.5"
},
"jest": {
"preset": "jest-expo",
"transformIgnorePatterns": [
"node_modules/(?!((jest-)?react-native|#react-native(-community)?)|expo(nent)?|#expo(nent)?/.*|#expo-google-fonts/.*|react-navigation|#react-navigation/.*|#unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg)"
]
},
"private": true
}
This error message occurs when trying to use a native module when debugging on the expo go app. The module should work in the standalone app.
You can find other ways to debug with the native modules here https://docs.expo.dev/build/internal-distribution/

No files matching the pattern were found: "'**/*.js'"

I downloaded expo project source code from github and tried to install node_module.
But I got following issue.
[error] No files matching the pattern were found: "'**/*.js'".
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 2.
My node version is 14.15.1
expo version: 4.0.8
react-native-cli: 2.0.1
and I will share my package.json file
{
"private": true,
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"eject": "expo eject",
"postinstall": "yarn prettier && yarn lint",
"prettier": "npx prettier --write '**/*.js'",
"lint": "eslint --ignore-path .gitignore --ignore-pattern \"!**/.*\" .",
"lint:fix": "eslint --ignore-path .gitignore --ignore-pattern \"!**/.*\" --fix ."
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.(js|jsx)": [
"yarn prettier",
"yarn lint:fix",
"git add"
]
},
"dependencies": {
"#babel/cli": "7.0.0",
"#babel/core": "^7.0.0",
"#babel/runtime": "7.0.0",
"#expo/vector-icons": "10.0.1",
"axios": "^0.18.0",
"babel-core": "^7.0.0-bridge.0",
"babel-plugin-inline-dotenv": "^1.2.2",
"concurrently": "^4.1.0",
"expo": "^37.0.0",
"expo-asset": "~6.0.0",
"expo-constants": "~6.0.0",
"expo-font": "~6.0.1",
"expo-google-app-auth": "^6.0.0",
"expo-image-picker": "~6.0.0",
"expo-location": "~6.0.0",
"expo-permissions": "~6.0.0",
"mobx": "^4.3.1",
"mobx-react": "^5.1.0",
"mobx-state-tree": "^3.7.0",
"moment": "^2.24.0",
"native-base": "^2.12.1",
"prop-types": "^15.6.2",
"react": "16.6.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz",
"react-native-design-utility": "^0.0.30",
"react-native-gesture-handler": "~1.3.0",
"react-native-reanimated": "~1.1.0",
"react-native-tab-view": "^2.10.0",
"react-native-webview": "~5.12.0",
"react-navigation": "2.18.2",
"react-redux": "^6.0.1",
"redux": "^4.0.1",
"socket.io-client": "^2.2.0"
},
"devDependencies": {
"#babel/plugin-transform-runtime": "^7.4.0",
"babel-eslint": "^10.0.1",
"babel-plugin-transform-decorators-legacy": "^1.3.5",
"eslint": "^5.1.0",
"eslint-config-prettier": "^3.1.0",
"eslint-plugin-react": "^7.11.1",
"husky": "^1.1.2",
"lint-staged": "^7.3.0",
"schedule": "0.4.0"
}
}
How can I fix this issue?
I'm not sure it works. You can try to overwrite your prettier configuration like this
"prettier": "prettier --write \"src/**/*.{js,jsx,tsx,ts}\""
Previous solution really worked. Сan also is used without quotes:
"prettier": "prettier --write src/**/*.{js,jsx,tsx,ts}"

Error when expo start in react native application (Stylesheet)

I'm making a react native application and there is an error that is making me sick.
Could anyone help me?
The error is shown below.
Dependencies:
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"#material-ui/core": "^4.11.0",
"#material-ui/icons": "^4.9.1",
"#react-native-community/async-storage": "^1.12.1",
"#react-native-community/masked-view": "^0.1.10",
"expo": "~39.0.2",
"expo-status-bar": "~1.0.2",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-39.0.3.tar.gz",
"react-native-animatable": "^1.3.3",
"react-native-elements": "^2.3.2",
"react-native-gesture-handler": "^1.8.0",
"react-native-safe-area-context": "^3.1.8",
"react-native-safe-area-view": "^1.1.1",
"react-native-snackbar": "^2.2.3",
"react-native-vector-icons": "^7.1.0",
"react-native-web": "~0.13.12",
"react-navigation": "^4.4.2",
"react-navigation-stack": "^2.8.4"
},
"devDependencies": {
"#babel/core": "~7.9.0"
},
"private": true
}
Thanks!
It seems to be an error in case, it should be StyleSheet and not Stylesheet

error while trying to add sign in with google button "RN GoogleSignin native module is not correctly linked..." - react native

I am trying to add a sign-in button of Google, and can't understand why it doesn't work fine. after download the package react-native-google-signin, and I have also installed #react-native-community/google-sign in and these both packaged doesn't work for me. the error message: "RN GoogleSignin native module is not correctly linked..."
code below:
import { GoogleSigninButton } from 'react-native-google-signin';
<GoogleSigninButton
style={{ width: 192, height: 48 }}
size={GoogleSigninButton.Size.Wide}
color={GoogleSigninButton.Color.Dark}
onPress={signInWithGoogle}
/>
my package JSON below:
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"#expo/vector-icons": "^10.0.6",
"#react-native-community/google-signin": "^3.0.4",
"#react-native-community/masked-view": "^0.1.5",
"expo": "~36.0.0",
"expo-facebook": "~8.0.0",
"expo-google-app-auth": "^8.0.1",
"react": "~16.9.0",
"react-dom": "~16.9.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz",
"react-native-fbsdk": "^1.1.2",
"react-native-gesture-handler": "~1.5.0",
"react-native-google-signin": "^2.1.1",
"react-native-link": "^4.1.0",
"react-native-paper": "^3.6.0",
"react-native-reanimated": "~1.4.0",
"react-native-safe-area-context": "0.6.0",
"react-native-screens": "2.0.0-alpha.12",
"react-native-status-bar-height": "^2.4.0",
"react-native-web": "~0.11.7",
"react-native-webview": "^8.1.2",
"react-navigation": "^4.2.2",
"react-navigation-stack": "^2.2.2",
"react-navigation-tabs": "^2.8.2"
},
"devDependencies": {
"babel-preset-expo": "~8.0.0",
"#babel/core": "^7.0.0"
},
"private": true
}

Unable to resolve "./components/connect" from "node_modules/react-redux/lib/index.js"

I have initialized a new react-native app using expo-cli.
After installing few dependencies, I got this error on build:
Unable to resolve "./components/connect" from "node_modules/react-redux/lib/index.js"
Here is my package.json file.
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"eject": "expo eject"
},
"dependencies": {
"eslint-config-rallycoding": "^3.2.0",
"expo": "^32.0.0",
"firebase": "^5.10.0",
"lodash": "^4.17.11",
"react": "16.5.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz",
"react-native-communications": "^2.2.1",
"react-native-router-flux": "^4.0.6",
"react-redux": "^5.1.1",
"redux": "^4.0.1",
"redux-thunk": "^2.3.0"
},
"devDependencies": {
"babel-preset-expo": "^5.0.0"
},
"private": true
}
I have been able to fix this issue by downgrading react-redux to version ^4.4.10

Resources