Getting the following error and not 100% sure why. Currently getting this issue when I run my app in ios simulator
I've tried to do npm install watchman, But I just saw the latest update on the npm packages and it seems like it's been depreciated.
events.js:292
throw er; // Unhandled 'error' event
^
Error: EMFILE: too many open files, watch
at FSEvent.FSWatcher._handle.onchange (internal/fs/watchers.js:127:28)
Emitted 'error' event on NodeWatcher instance at:
at NodeWatcher.checkedEmitError
at FSWatcher.emit (events.js:315:20)
at FSEvent.FSWatcher._handle.onchange (internal/fs/watchers.js:133:12) {
errno: -24,
syscall: 'watch',
code: 'EMFILE',
filename: null
}
This error was caused by watchman.
You should run brew install watchman in the terminal.
If watchman fails to install, you should change the ownership of these directories to your user by
sudo chown -R $(whoami) /usr/local/etc/bash_completion.d /usr/local/lib/pkgconfig /usr/local/var/log
please refer to the tips in your terminal.
Finally you run brew install watchman. The problem should be solved.
For people with Mac M1 who are running into this problem, I tried the above brew install and upgrade watchman but they didnt work. My specific problem was that react-native project would build on the simulator fine through 'npm run ios' but when archiving or building through xcode I would get this error. After hours upon hours this is what did:
Go into your Security in your System Preferences of your Mac and give full disk access to watchman
The project you are building for some reason (Probably because Apple restricts access) does not work when in your Desktop or your Documents location. Once I moved it to under /Users/myname/ it finally built and archived in xcode.
Hopefully this will save someone else the 6 hours I spent debugging and trying to figure out this.
EDIT: THIS BROKE AGAIN SO HAD TO FOLLOW THIS NEXT TO FIX IT:
This error is because of a bug in module fsevents for mac m1 silicon. See the thread: https://github.com/facebook/metro/issues/668
It got fixed with new version of watchman. Upgrade your watchman through brew. Delete your project and download from git and rebuild everything along with pod install and then it should archive no problem.
Related
I'm using Macbook pro-2020 apple M1 Chip, I have created a new ReactNative project and it runs fine on the simulator but if i have to install any other plugins, and have to install pods. it gives me errors like this.
i have installed all the requirements app running fine but once it comes pod installs it fails each and every time. any help would be much appericiated.
I believe this has been answered in how-to-running-cocoapods-on-apple-silicon-m1
I recommend following the updated answer for 2022. If you haven't already, use Homebrew, even tho it's not recommended by the maintainers. M1 with ARM architecture is amazing but many libraries are still not compatible and need to be run in x86 mode.
I would uninstall everything, including and gems you used originally, and run the following Homebrew commands and link them all....
brew install node
brew install yarn
brew install cocoapods
Reinstalling those should now work when you run pod install inside your ios file. This is what worked for me. Hope this helps.
I was facing the same error, this is what worked for me:
I first reinstalled the node, yarn, CocoaPods, after that I run the following commands:
brew link cocoapods
If still gives you error, remove old linked pod using following command:
rm '/opt/homebrew/bin/pod'
Now run this command again:
brew link cocoapods
Once the above command works successfully, then move to your project's iOS folder and run the following command:
pod install
I found an error in sharp.
After that, I found a blog in which they ask to delete sharp from the node module and run sudo npm i.
I have gone through GitHub and write minipass - 2.7.0
After that, I got a new error in
vips/vips8 file not found #include <vips/vips8>
I'm using Ionic with Angular on Macbook
I use commands which is
1.sudo npm install
2.sudo npm i gulp-sass -ES --unsafe-perm=true
3.sudo ionic cordova platform add ios
I very recently ran into a similar issue after making some changes to a project's package.json on my Mac (not an Angular or Cordova project).
I came across this GitHub issue for the sharp package which mentioned you may need to update the globally-installed version of libvips: https://github.com/lovell/sharp/issues/1148
In my case, since I use Homebrew but had not directly installed this package previously, I was able to resolve by running brew install vips and then re-running npm install. Note that it has a lot of dependencies so installation may take some time.
Edit: if that doesn't work, you may need to try a fresh install by removing node_modules, then re-running npm i.
This might be not applicable to everyone, but remove package-lock.json and node_modules directory first and then try npm install again. (I also added the minipass in my package.json, by the way)
In my case, I had encountered the same error, but I could solve it by doing the above.
I have an app running fine with React Native 0.57.7 on CircleCI on Xcode 9.
But we need to bump up Xcode version to 10.1.0.
But when I switch it, Ci stops to work, even with enabling legacy system (-UseNewBuildSystem=NO or -UseModernBuildSystem=0 being passed to Fastlane's build_ios_app), I get "Myapp.app/main.jsbundle does not exist" error.
▸ + echo 'error: File /Users/distiller/project/ios/build/Build/Intermediates.noindex/ArchiveIntermediates/Myapp/BuildProductsPath/Release-iphoneos/Myapp.app/main.jsbundle does not exist. This must be a bug with'
▸ error: File /Users/distiller/project/ios/build/Build/Intermediates.noindex/ArchiveIntermediates/Myapp/BuildProductsPath/Release-iphoneos/Myapp.app/main.jsbundle does not exist. This must be a bug with
▸ + echo 'React Native, please report it here: https://github.com/facebook/react-native/issues'
▸ React Native, please report it here: https://github.com/facebook/react-native/issues
After some hours spent just to figure out what was going on with it, I found out the issue: the build is failing silently because the docker image for Xcode 10.1.0 on CircleCI is missing some dependencies needed to build the app by React Native.
The error was just saying “main.jsbundle does not exist”. It happens when xcode runs react-native-cli bundle from react-native-xcode.sh file. And it doesn't tell the root cause for the error: watchman is missing in the docker image used by this Xcode version.
Why those images don’t have the same installed packages? I don’t know. I was only expecting the same installed packages between the images.
Adding brew install watchman makes the CI pass again:
- run:
name: "Install React Native dependencies"
command: |
brew update
brew install watchman
I wish react-native-xcode.sh could return the root error instead of just main.jsbundle does not exist
getting this error
** BUILD FAILED **
The following build commands failed:
CompileC /Users/karthikn/AwesomeProject/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/Objects-normal/x86_64/RCTTabBarItem.o Views/RCTTabBarItem.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/AwesomeProject.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/AwesomeProject.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Xcode 8.2 still occur same error. Three lines bellow fixed it for me :)
Downgrade react(16.0.0-alpha.12 -> 16.0.0-alpha.6) & react-native(0.45.0 -> 0.44.0)
rm -rf node_modules/react
npm i react#16.0.0-alpha.6 -S
npm i react-native#0.44.0 -S
Then run react-native run-ios
Your build could be failing because of the current node js version installed, or due to your pod files or a number of other reasons.
This error may also be when cloning a react native repository from github.
This solution may work as I was able to recreate this issue(refer to the screen shots):
Solution one:
firstly:
If you have the latest version of node js installed you may have some compatibility issues with some of the dependencies, install the recommended version of Nodejs instead.
after installation, reinstall your dependencies and update your pod files:
npm install
cd ios
pod install
or
pod update
solution two:
this can happen if you haven't installed react native previously on your system and are trying to run a clone react native repository from github.
brew install watchman
sudo gem install cocoapods
then in the rn project clone
cd ios
pod install
Problem:
This is what the error message looks like:
legacy compatibility issues:
Build failed
Solution:
After following the above steps this issue was resolved instantly:
If it's your first project, you may have the same problem than me:
do NOT use space in your project path! 🎉 😄
If your xcode is open, close it
Remove DrivedData
Update your pod files using pod update command
Run npx react-native ios command
its worked for me i hope work for you too
There's a good chance you're running an outdated version of React-Native and your template is no longer compatible.
There are instructions provided on ways to upgrade.
The simplest would be to run react-native upgrade and you'll be prompted with files react-native wants to overwrite. Clicking yes through all the prompts solved this issue for me but if you're concerned about losing any changes, it's recommended to install npm install -g react-native-git-upgrade and merge any conflicts after running react-native-git-upgrade
Try sudo react-native run-ios
This helped me
Check this In Your info.plist Bundle identifier
Or Add this Bundle identifier name as --> com.cmpname.yourapp // change name according
DO NOT use space in project path. It had solved my problem.
Replace Boost C++ Libraries with this one Download Link
/node_modules/react-native/third-party/boost_1_63_0
seems like there is an issue with the react-native version, downgrading the version will resolve the issue. Use the following commands:
rm -rf node_modules/react
npm i react#16.0.0-alpha.6 -S
npm i react-native#0.44.0-alpha.6 -S
react-native run-ios
There are different problems that cause this issue. I'll post here what I did to resolve in my case.
1 - Delete the folder node_modules and the folders of android and ios from project root:
rm -rf node_modules/ ios/ android/
2 - Rebuild the folders:
npm install && react-native upgrade
or (If you have used yarn in the project)
yarn install && react-native upgrade
3 - After that, just run the command again:
react-native run-ios
or
react-native run-android.
I hope it helped =)
I am using Mac OS Sierra v10.12 and getting error while adding to my Phonegap project within the folder myApp:
$ node -v
v7.2.0
$ npm -v
3.10.9
$ cordova platform add ios
received following errors:
Error during untar for /Users/{user_name}/.cordova/lib/npm_cache/cordova-ios/4.3.0/package.tgz: Error: EACCES: permission denied, open '/Users/{user_name}/.cordova/lib/npm_cache/cordova-ios/4.3.0/package/package.json'
Error: Failed to fetch platform ios
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
Error: EACCES: permission denied, open '/Users/{user_name}/.cordova/lib/npm_cache/cordova-ios/4.3.0/package/package.json'
Note: {user_name} is my mac user Id, Can anybody help me!
I think you have to issue with permission to add platform .
Try to following :
$sudo chown -R {user_name} /Users/{user_name}/.cordova/lib/npm_cache/
For more please check here.
Hopes this will help you !
Maybe this is a cache problem of cordova. Delete the cache and try to add the platform again:
rm -rf ~/.cordova
Try upgrading npm, this worked for me:
npm install npm#latest -g