I have a problem with react-native: despite having installed async-storage with the appropriate command and with the right version, I get the following message:
Module not found: Can't resolve '# rect-native-async-storage / async-storage'
I also sent the npm cache clean --force command to clean the cache, but nothing has changed.
What can I do?
Thank you in advance.
If that is your Module: # rect-native-async-storage / async-storage
Than it is incorrect it should be react.
Be sure to follow every step in here: https://react-native-async-storage.github.io/async-storage/docs/install/
Related
I am working on an expo project and everything is working fine, but I began to get a warning message when android is building as
Warning: Invalid version react-native#0.64.2 for expo sdkVersion 43.0.0. Use react-native#0.64.3
The app is still running fine but I don't how to fix this error yet and I want to know if it won't cause an issue later.
I have tried to run npx react-native upgrade 0.64.3 but it didn't work, I got this error
info Fetching diff between v0.64.2 and v0.64.3... error Fetch request
failed with status 404: 404: Not Found. error Failed to fetch diff for
react-native#0.64.3. Maybe it's not released yet?
changing the version of react-native manually in the package.json and run expo install worked for me
I use the expo doctor command it allows diagnose issues with the project.
I would recommend using the expo upgrade command. It upgrades the project packages and config for the given SDK version.
More to find here.
I just faced the same issue. Basically it's telling you should use a higher version of your react-native. I solved it just by updating it to the specified version.
npx react-native upgrade 0.64.3
More info here.
Cheers,
If as in my case one need a specific version of react-native, let's say older because some legacy dependencies in a particular project that for some reason can't be upgrade, then change the version in the package.json won't work.
What worked as the cli suggested is to use:
expo doctor --fix-dependencies
That installed the correct lower version of react-native
To find out actual problems run this command :
expo doctor
To solve all problems regarding package conflicts run this command:
expo doctor --fix-dependencies
Use sudo on Unix based OS if you have permission issue to run those commands.
To solve the error, I used the below command:
npm install react-native-clean-project --save-dev
It is a library that allows us to resolve conflicts.
This library is added to your dependencies.
This handles the problem and if it is not the case add this command:
react-native clean-project-auto
I am trying to install the following package through yarn yarn add react-native-gesture-handler#1.10.2. I read multiple answers to this question yet none was of use. I think the problem might come from the fact I am on a windows computer yet don't know how to solve it.
Whenenever y try to do a yarn add ..#version I get the following error:
yarn add v1.22.11
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is
advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json
[1/4] Resolving packages...
[2/4] Fetching packages...
error An unexpected error occurred: "C:\\Users\\...\\AppData\\Local\\Yarn\\Cache\\v6\\npm-unbox-primitive-1.0.1-085e215625ec3162574dc8859abee78a59b14471-integrity\\node_modules\\unbox-primitive\\.yarn-metadata.json:
Unexpected token \u0000 in JSON at position 0".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\...\\OneDrive\\Documents\\GitHub\\wc_app\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
I have same problem with installing next.js app many times
now its fixed
with clear cache of yarn
yarn cache clean
I have faced a similar problem while creating a latest react native project(0.65) in my Windows machine:
error An unexpected error occurred: "C:\Users\arefin\AppData\Local\Yarn\Cache\v6\npm-is-ci-3.0.0-c7e7be3c9d8eef7d0fa144390bd1e4b88dc4c994-integrity\node_modules\is-ci\.yarn-metadata.json: Unexpected token \u0000 in JSON at position 0".
My system configuration for react native development is as follows:
node --version: v15.7.0
yarn --version: 1.22.5
npm --version: 7.12.1
java --version: java 15.0.2 2021-01-19
I used these commands below, which finally solved the problem in my case:
yarn init && yarn add react-native && yarn react-native init
SpendnGain
which I found at here
So I installed the react-navigation 5.x following the documentation, and after pasting the import 'react-native-gesture-handler'; in my index.js and internal error popped up stating it couldn't resolve some 'main' module which is specified in the package.json of react-native-gesture-handler.
This is the error i'm getting. I looked at some other similar solutions wherein they stated to link react-native but those steps were for a previous version i guess.
This says that there's index in the react-native-gesture-handler but there is!!
Please help as i'm a newbie to react-native and such errors just demotivates
Try removing the apostrophe from your project name.
Occasionally after installing, the Metro Bundler's file watcher appears to become desynchronized with the state of the node modules directly, or the cache can become corrupted.
Try deleting your node_modules/ directory, reinstalling using yarn or npm i and then use:
react-native start -- --reset-cache
i had everything working fine, great tool Expo. however, after updating the expo (npm i -g expo --save) i started getting this problem.
i managed to solve the invalid version issue by adding "sdkVersion": "38.0.0" to my app config - but it was working fine before that. don't know why it started appearing now. struggling to solve "unknown option `--assetExts'" issue here, could you please help ?
Warning: Problem validating app.json: Unable to perform cache refresh
for \schema-undefined.json: Error: Request failed with status code 404.
Error: Invalid sdkVersion. Valid options are 7.0.0, 8.0... 38.0.0
error: unknown option `--assetExts'
Metro Bundler process exited with code 1
Set EXPO_DEBUG=true in your env to view the stack trace.
Problem got fixed for me after updating the expo-cli to the latest version:
npm install -g expo-cli
I had the same problem, what solved it for me was clearing the react-native packager cache.
I ran: expo start --clear
Expo cli docs:
https://docs.expo.io/workflow/expo-cli/
In my package I added:
"start:clear": "expo start --clear",
just to help in the future...
I am facing below issue while compiling new react native project. How to resolve this issue? Already followed below commands to resolve but not solved.
updated react native
updated npm
reset react-native cache
reset npm cache
all possible commands tried at my side.
try to run react-native run-ios --verbose, that gives you an approach of what is happening, in my case, I had this error:
the project named 'foo' does not contain a scheme named 'bar'
so I had to deal with the name and the scheme following this steps:
https://stackoverflow.com/a/35500038/1715471
Hope that helps...