React-Native stuck at Loading dependency graph done. No errors - node.js

I have a problem with my app, after running react-native run-android, the procees stop with blank page app at get stuck at loading dependency graph done... nothing happens. Everything was ok and suddenly not work anymore.
I tried everything i found on the internet... still not working. Any ideas?
package.json
This is what i get..

Probably, it might be an issue with watchman. Please try to close all terminals and emulator, clean the project and give the build. It did worked with me when i came across the same situation.

When you’re unable to load a bundle, look at the packager logs or the error message displayed in the Expo client to see if it’s related to the packager. If so, you should try clearing the packager’s state to reduce the chance the bug is related to a stale cache or corrupt process.
These instructions are for macOS and Linux, but the general ideas apply to Windows as well.
Stop XDE/exp, which should also stop the packager. Check your list of running processes to ensure these processes are not running.
Delete node_modules in your project
If your project depends on other local projects (e.g. has a file:
URI in its dependencies), clear those local project’s node_modules
directories too for good measure even though it’s probably
unnecessary.
Clear your Yarn or npm cache, depending on which you’re using, with
yarn cache clean or npm cache clean
Run yarn or npm i to install your dependencies again
Run watchman watch-del-all to clear Watchman’s state
Kill the watchman daemon process
Delete the packager’s cache directory with rm -fr $TMPDIR/metro*
Start XDE or exp
With exp, run exp r -c for good measure
And just to be sure, force quit the Expo client on your phone or simulator and re-open it.

None of the above answers worked for me. I had this issue after transferring my data from my old mac to my new one. It turned out that the brew installed python was not properly transferred. So, basically I uninstalled and reinstalled watchman.
brew uninstall watchman python
brew install watchman
I then restarted the packager, and I was ready to go.

Related

Bundling errors after updating an npm package in React Native app

I'm building a React Native app which, at this point, doesn't have too many dependencies.
Every time I update an outdated npm package, I am GUARANTEED to run into bundling errors. It could be any package. I then spend hours trying different ways to clear npm cache, project cache, etc.
Does anyone else have this issue? Is there a "standard" set of commands I should run after upgrading ANY npm package? This is extremely frustrating!
This screen shot shows today's flavor of the issue:
BTW, I'm on Windows 10, using VS Code. My React Native version is 0.63.1, Node version is 14.7.0 and npm version is 6.14.7
UPDATE:
After a couple of hours of messing around and removing node_modules folder several times and issuing the following commands a few times, it's now started to work. Unfortunately, I can't put my finger on what fixed it. As I said, I did the same things a few times.
Here are the steps I repeated a few times -- though once should be enough:
Deleted the node_modules folder
In root folder, I ran npm cache clean --force
I then reinstalled all npm packages by running npm i
Went into cd android folder and ran ./gradlew clean
Then in project root, I ran npm start -- --reset-cache
Unfortunately, doing this the first time didn't fix the issue. It looks like I have to waste a couple of hours for things to get back to normal! Any idea how to make this problem go away for good?
I think this error is that you have not start the metro bundle. Try react-native start and then re-run the app

Different NPM version used when generating React app

When I try to create the starter React tutorial app using powershell, I get the below error:
"You are using npm 2.15.12 so the project will be boostrapped with an old unsupported version of tools".
"Please update to npm 3 or higher for a better, fully supported experience".
However, my NPM version is 6.11.3 as seen below.
What I have tried:
I have ran powershell as admin as answered in this question and restart.
I have also uninstalled and reinstalled Nodejs completely.
So after an extra hour digging around, I saw a few posts with similar (but not exactly) the same issue. I decided to install Yarn and install with that.
After install, I ran yarn cache clean and ran npx create-react-app your-app and it worked. Sorry for bothering you all.
I had the same problem. I'm running WSL with ubuntu, and yarn cache clear didn't work, but I noticed a node modules directory created in the project. I think it was messing with the node version so I deleted it. It worked

Is it me or yarn?

apt works great for me. Rarely a problem and always easy to fix.
conda works great for me. Rarely a problem and always easy to fix.
I can't seem to get yarn to work...ever. Always some strange problem with node version or gyp libraries. Even when I get all of that fixed I get lots of warnings and then errors like
error An unexpected error occurred: "ENOENT: no such file or directory, lstat '/home/balter/.cache/yarn/v4/npm-tar-fs-1.16.3-966a628841da2c4010406a82167cbd5e0c72d509/node_modules/tar-fs/test/fixtures/a/hello.txt'".
Turns out if I run yarn install again there is a different file it can't find. Just for fun, I did
for i in {1..100}; do yarn install; done
Yup it errored on a different file every time, but never did "work."
Is it me, or is yarn just really fragile? If I want to install a package from github and the install instructions use yarn, is there a way around using yarn?
Also, no tag for "yarn"
I had the same problem in WSL one time and fix that using yarn cache clean
I was getting this same frustrating and hard to debug error. The problem in my case seemed to be yarn workspace behaviour caused by different versions of the same dependency in different packages (specifically ava versions 2 and 3). Only once I'd upgraded all occurrences of ava to their latest did I stop getting this error.
I was running into this same problem on Windows 10. I tried yarn cache clen because I saw that the tar-fs dependency was corrupted on disk going into the cache path (C://...AppData/Local/Yarn/Cache/npm-tar-fs...).
I saw that using yarn cache clean was deleting all cache files except for this one that was corrupted. I also tried deleting it manually and Windows wasn't allowing it.
So the solution was going into cmd and deleting it from there using the command DEL /F /Q /A <File Path>.
After that I ran yarn install again and it worked!

ec2 hangs on npm install

I have free tier ec2 (1GB RAB, 500MB swap memory)
When Jenkins performs npm install on the project, ec2 just hangs, stops responding and only reboot brings it to life.
With htop, I analysed the situation and figured out that RAM just exhausts and chokes and additional swap memory I created doesn't help.
Since I'm having a school project, I want to use free tier and somehow launch the project there (I tried npm run build too, but for now it has too many issues).
I tried yarn too, but there's an issue with different versions of babel-loader being required by two other packages.
Is there a way to perform npm install in an automatic fashion (so that Jenkins can do it with just a script shell) and without hanging ec2?
I ran into the same problem where the server just would stop installing. While it is definitely possible to upload the node_modules manually, I preferred to let npm do it for me. I solved it by deleting half of the dependencies before running npm install. After it finished i added them back and ran npm install a second time. Now everything is installed.
From now on npm install should work fine, since most dependencies are already installed. However adding or updating many dependencies at once might result in a hanging server again.

cannot uninstall node and npm completely on high sierra

I recently installed Node on my MacBook running High Sierra 10.13 using the .pkg file supplied on their website.
After a few hours of experimenting with installing other packages and writing scripts, I decided I would like to uninstall both Node and NPM to get a fresh start.
I tried all of the top answers from this thread, but to my dismay, after having followed all instructions, and repeated all steps many times, terminal would still recognise the Node and NPM versions.
I ended up running a bash script through terminal which I found on the same thread, which ended up doing nothing but downgrading my current version of Node to 0.10.8 - making it a lot more difficult to delete in the long run.
I've re-done all of the steps from the aforementioned thread with no avail, and terminal still stating that it has version 0.10.8 (and NPM just completely not working at all)
Currently at my last stance of what to do, so hopefully someone on here can help me with my problem.
Cheers.
After searching through Google and StackOverflow for hours, I finally came up with a solution to the problem on my own.
Running the type command within terminal against node, I got this returned:
:~ myusername$ type node
node is /Users/myusername/.nvm/v0.10.48/bin/node
Subsequently, after deleting that folder, Node appears to be completely removed from my system.
I have since made sure that I have deleted all node and node_module folders that I could find within /usr/ to make sure - and I would suggest that anyone attempting this also do the same.
Try to run the following command
brew uninstall node
After the above command, you need to scan manually for node_modules if exists. Try following.
grep -irl "node_modules/node"
sudo rm -rf result_from_above_command
rm -rf ~/.npm
I hope this will remove all the node and it's components. As I have done like this, once before.
Thank you.

Resources