Watchman Version Showing 0.0.0. Preventing npm start on React Native App - react-native

I am trying to develop a react native application on MacOS, but I have been running into issues with installing watchman onto the machine. I have been running the command brew install watchman and whenever I enter the command watchman version the output displays version: 0.0.0. However, directly after running the first installation command over again, I see Warning: watchman 2022.06.06.00 is already installed and up-to-date which is really confusing me.
I have tried various different troubleshooting techniques such as uninstalling and reinstalling watchman, instead of using brew I attempted using sudo port install watchman with MacPorts, removing the .watchmanconfig file and re-creating it, and lastly restarting my device, but none of these solutions have seemed to work for me.
Whenever, I open my react native project and run the command npm start, this is the output that I see,
jest-haste-map: Watchman crawl failed. Retrying once with node crawler.
Usually this happens when watchman isn't running. Create an empty `.watchmanconfig` file in your project's root folder or initialize a git or hg repository in your project.
...
watchmanResponse: {
error: 'std::__1::system_error: open: /Users/USER/Desktop/ReactNativeApp: Operation not permitted',
version: '0.0.0'
}
This error message ends the npm start and because of this, I am unable to run npm run ios and continue with the development of the application. If anyone happens to know of any fixes or has experienced this before I would appreciate it if you share how I can resolve it. Thank you.

We can resolved this when we put our project outside from those folder Desktop,Download and Document
then run
npm start
It will be work
thanks

Related

expo always returning me with "-bash: expo: command not found" everytime i go to set up a project, "expo init projectname". how do i resolve this?

have downloaded latest version of node.js on mac
terminal says ive downloaded latest version of expo cli
if i try to run my first project in terminal; expo init project name, am always met with the same error. -bash: expo: command not found.
when i check terminal to make sure that expo is installed, i am also met with: -bash: expo: command not found.
i have spent at least 3 days trying to resolve this problem.
any help towards this resolution would be greatly appreciated
How have you downloaded the Expo CLI? It may be important to note that if you don't install the package globally, like npm install -g expo-cli, it may not be properly executable.
[Additionally, One thing I've found when installing commands is that it can help to restart your terminal. Sometimes after you've installed something new, not everything will be in place, but it might be there when the terminal restarts.]

Cannot start react-native server

I have React-native project. When I want to start it, I run npm start or yarn start, and I get this:
$ yarn startyarn run v1.7.0
$ react-native-scripts start
11:36:37: Starting packager...
***ERROR STARTING PACKAGER***
No issue with doctor-watchman-version
No issue with doctor-problem-checking-watchman-version
No issue with doctor-both-app-and-exp-json
No issue with doctor-schema-validation
No issue with doctor-validate-asset-fields
No issue with doctor-schema-validation-exception
No issue with doctor-unversioned
No issue with doctor-versions-endpoint-failed
No issue with doctor-invalid-sdk-version
No issue with doctor-node-modules-missing
No issue with doctor-react-native-not-installed
Starting Metro Bundler on port 19001.
Metro Bundler ready.
jest-haste-map: Watchman crawl failed. Retrying once with node crawler.
Usually this happens when watchman isn't running. Create an empty `.watchmanconfig` file in your project's root folder or initialize a git or hg repository in your project.
Error: Watchman error: too many pending cache jobs. Make sure watchman is running for this project. See https://facebook.github.io/watchman/docs/troubleshooting.html.
If I uninstall wathcman Packeger get stucked.
Creating .watchmanconfig file, also didn't help.
(Linux Mint OS)
Hours of searching. I have not found a solution yet :(
Try this:
npm r -g watchman
brew update && brew upgrade
brew install watchman
watchman shutdown-server
This command from this GitHub issue worked for me
Try this:
$ npm install
If you are using visual studio, in the bottom of the view there is button to restart. click that and run

React native packager fails to create jsbundle

I just upgraded react-native version to 0.48.1 from 0.30 and I am facing a weird issue.
I fixed all the peer-dependencies for the libraries that I am using. then ran command,
react-native start
running above command starts packager. Now when I hit below url to generate jsbundle,
http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false
I am getting below error,
"message":"Ambiguous resolution: module '$PROJ_ROOT_DIR/index.android.js' tries to require 'react-native', but there are several files providing this module. You can delete or fix them:
$PROJ_ROOT_DIR/node_modules/jest-react-native/node_modules/react-native/package.json
$PROJ_ROOT_DIR/node_modules/react-native/package.json"
$PROJ_ROOT_DIR is my project directory path.
I don't have any '$PROJ_ROOT_DIR/node_modules/jest-react-native/node_modules/' directory in my setup.
I tried deleting node_modules directory then running npm install. but nothing changed.
I have also tried, clearing packager cache by running command,
ls -l $TMPDIR/react-*
but nothing happened.
Has anyone faced similar issue? any suggestions?
Thanks in advance!
In case anyone else facing same issue of similar issues, Clearing cache using below command worked for me.
npm start -- --reset-cache
I was trying react-native start -- --reset-cache command which does nothing(my bad.).

No bundle URL present (react native)

Just installed react native and trying to get Hello World up and running. Been receiving this error for the last few hours:
"No bundle URL present.Make sure you're running a packager server
or have included a .jsbundle file in your application bundle."
I've referred to this: What means of no bundle URL present in react-native? and other similar questions, and tried everything: using my ip addresse, different combos of react-native run-iso and npm install while running and not running, tried deleting builds, cleaning project, restarting Xcode, simulator multiple times, tried react-native-upgrade, edited into.plist to allow arbitrary loads, manually setting the path to my index.ios.js, everything, and nothing works.
I noticed many ran into this issue when trying to build on their device. i'm not trying to do anything fancy, just get 'hello world' up and running.
Any other solutions I am not aware of?
cd into YOUR_PROJECT/ios and rm -r build, then run again react-native run-ios
I have the same issue, my problem was with info.plist I just
config it as the following:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSAllowsArbitraryLoadsInWebContent</key>
<true/>
<key>NSAllowsLocalNetworking</key>
<true/>
</dict>
from this solution https://stackoverflow.com/a/48471978/1627358
And then add Bash config file .bashrc with this command:
echo "alias rni=\"kill \$(lsof -t -i:8081); rm -rf ios/build/; react-native run-ios\"" >> ~/.bashrc; source ~/.bashrc
Then run rni
from this solution https://stackoverflow.com/a/44080527/1627358
And it works fine with me.
run the following code:
killall -9 node
rm -rf ios/build
react-native run-ios
it will open launchpackager.command and the application will install on the ios simulator
The solution that worked for me.
You need to run:
yarn start
And at the same time (in a different terminal window):
yarn run:ios
Assuming that you are using nvm and multiple versions of node installed, here is the solution:
Say that you run npm install -g react-native-cli in node v6.9.5.
Now make node v6.9.5 as default by running nvm alias default 6.9.5
Now run react-native run-ios
The problem is, you have multiple versions of node installed via nvm and to install react-native-cli you have switched or installed latest version of node, which is not marked as default node to point in nvm yet. When you run react-native run-ios this opens up another new terminal window in which default nvm is not pointed to the node version where you have installed react-native-cli. Just follow the above setup, I hope that should help.
Answered the same here: https://stackoverflow.com/a/45267703/1292050
I had this issue after I run the following commands to clean the project to see the changes which were invisible because of the cache and so on:
watchman watch-del-all
rm -rf node_modules && npm install
rm -rf /tmp/metro-bundler-cache-* or npm start -- -- reset-cache
rm -rf /tmp/haste-map-react-native-packager-*
The reason for the issue was in the comment in dom-structure which didn't let the application run on the device. So, check the comments too ;)
faced similar issue while running in real device app was getting crash after uploading to testflight upload and install folks this issue is killer
saved by this link
https://onexlab-io.medium.com/no-bundle-url-present-fixed-ca2688a80f66
The solution that worked for me.
> sudo vim /etc/hosts
add
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
then
> sudo killall -HUP mDNSResponder
the reason is I change hosts
I had the same issue happen to me not too long ago. It appears that if you renamed the project to something else and the project folder itself was renamed, you need to make sure you replace all instances of the old name with the new name and do not forget to change file names of your .xcscheme in ProjectName > ios > ProjectName.xcodeproj > xcshareddata > xcschemes. I also had to remove the build directory. Hope this works for you as well!
I've run into this issue when I tried to sync my files to iCloud Drive. I have no idea what causes this, but as soon as I turn off my iCloud Drive and reinstall brew and Node, it started to work again. I can only think that when I turned on iCloud Drive, I might have ended up having two different Node versions or any other dependency.
To debug, your best first step is to scroll through the log text that outputs in the terminal window where you fired off "npx react-native run-ios" and search for the word like "error" or "failed". This will point you toward something more specific than the general "No bundle URL present" error.
For example, you might see something like "BUILD FAILED The following build commands failed: ProcessInfoPlistFile". In this example, I'd then know to go check on my Info.plist. You might see something different, but the debug methodology would still be the same.
If you are trying to run iOS, another idea is to build your app with Xcode itself by opening <YOUR_PROJECT_NAME>.xcworkspace with Xcode, then review its error messages.
Similarly, if you are trying to run Android, then try running with Android Studio and review its error messages.
Lots of answers are given, but one thing you should surely be taking care of while facing this issue is to
make sure that your Metro server is running.
npx react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios' --assets-dest='./ios'
Try This, clear project, and run in xCode.
This relates to the answers from #Daria Kozlova and #Daniel Twork
I needed to have the server running in another tab, i.e. yarn start
But what I hadn't noticed is that the server had crashed with an error like:
jest-haste-map: Watchman crawl failed. Retrying once with node crawler.
Usually this happens when watchman isn't running. Create an empty `.watchmanconfig` file in your project's root folder or initialize a git or hg repository in your project.
Error: Watchman error: std::__1::system_error: open: /Users/anentropic/Documents/Dev/Work/myproject/mobile-app: Operation not permitted. Make sure watchman is running for this project. See https://facebook.github.io/watchman/docs/troubleshooting.
...
watchmanResponse: {
error: 'std::__1::system_error: open: /Users/anentropic/Documents/Dev/Work/myproject/mobile-app: Operation not permitted',
version: '2022.09.12.00'
}
The fix for that can be found here:
https://github.com/facebook/watchman/issues/977#issuecomment-1189903929
i.e. run:
watchman watch-del-all
watchman shutdown-server
and then yarn start again
react-native run-ios works now
just try,
npm start
npm react-native run-ios
The below solved the same problem i had
brew update
brew reinstall watchman
Edit /etc/hosts
127.0.0.1 localhost
this is work for me !!!

How to stop angular-cli freezing on "loadRequestedDeps: silly install loadAllDepsIntoIdealTree"?

I am running Windows 8.1 with node version 7.7.3 and npm version 4.1.2.
I have been working on an Angular tutorial without issues. At some point since finishing that tutorial I installed Python. I am not sure if it is related, but I have mentioned it just in case.
Today I am trying to create an Angular application and it hung without completing.
I did some research and it tells me to do this:
npm uninstall -g #angluar/cli
npm cache clean
npm install -g #angular/cli
The last command hangs at this point:
loadRequestedDeps: silly install loadAllDepsIntoIdealTree
I opened the command prompt "run as administrator" to run these commands.
Everything I try fails. I have connected to a completely different network to eliminate that as the problem and that didn't fix anything. I have uninstalled and reinstalled node.js and that hasn't fixed the problem either.
I can ping registry.npmjs.org just fine.
What is causing this error?
I finally found the answer! I ran the following command in the command window:
echo %temp%
It had 3 temp paths in there. I removed the two I didn't need and voila, it works!