React Native project initial compilation error - xcode

I created a new React Native project and ran it in Xcode. I get following error in the terminal and can't figure how to fix:
ERROR EACCES, permission denied '/Users/andrey.pokrovskiy/.babel.json'
{"errno":3,"code":"EACCES","path":"/Users/andrey.pokrovskiy/.babel.json","syscall":"open"}
Error: EACCES, permission denied '/Users/andrey.pokrovskiy/.babel.json'
at Object.fs.openSync (evalmachine.:438:18)
at Object.fs.writeFileSync (evalmachine.:977:15)
at save (/Users/andrey.pokrovskiy/Desktop/lab/NewiOsApp/node_modules/react-native/node_modules/babel-core/lib/api/register/cache.js:35:19)
at process._tickCallback (node.js:419:13)
at Function.Module.runMain (module.js:499:11)
at startup (node.js:119:16)
at node.js:906:3
I've tried chown the file and looked for a solution but no luck.
Meanwhile Xcode throws Apple Mach-o linker error with 25 errors inside.
I never worked with Xcode so have no clue what that means.
Seemingly easy installation turned into a nightmare for me.
Any help would be appreciated!

I had met the same problem, and I fixed it by executing the following command:
sudo chmod 777 /Users/xxxx/.babel.json
and then re-init the react-native project
react-native init awesome-project

Related

error: error reading EXAppLoaderProvider/EXAppLoaderProvider.m'

After cloning the git repo of a expo project, and doing an npm install/pod install, I receive the following error:
error: error reading '/Users/user/Desktop/example-project/node_modules/expo-app-loader-provider/ios/EXAppLoaderProvider/EXAppLoaderProvider.m'
I tried to delete the Derived data, build with legacy mode, delete podlock and package lock files, with no luck
Any ideas what is happening/must be done?
Thank you!

Command PhaseScriptExecution failed with a nonzero exit code in react native [XCODE 12.5]

I’m currently developing an app in react native and I’ struggling with this error: “Xcode 12.5: Command PhaseScriptExecution failed with a nonzero exit code“.
Now I’ve already tried to:
Uninstall and reinstall all thing related to pods.
Delete and reinstall node_modules folder.
I’ve red there’s something to in keychain but again, it doesn’t work.
I think it could be a permission error or something like that, because it occurs at the end of the app build.
Thank you
Finally I found the solution, run this command in your project folder from temrinal:
react-native bundle --platform ios --dev false --entry-file index.js --bundle-output ./ios/main.jsbundle
In my case it was unable to resolve module 'react-native-audio' and mistakely copied ../components/react-native-audio from somewhere else..
I hope you had the same error and hope it helps

`npm install` issues/failure with expo-cli and react-native-app

I really need some help with what seems to be the most basic task (setting up the expo/react-native project). I've installed the expo-cli (v3.11.7), react-native (v2.0.1), watchman (v4.9.0) and node (v12.14.1). I've followed the tutorial up until the point where I need to run expo start and I get the following error:
Your project is in SDK version >= 33.0.0, but the expo package version seems to be older.
Error: node_modules directory is missing. Please run npm install in your project directory.
Couldn't start project. Please fix the errors and restart the project.
Set EXPO_DEBUG=true in your env to view the stack trace.
I've then run npm install and tried again but the same error pops up. I've removed the node_modules folder and that didn't work either.
Update:
When I npm install this is the error I'm seeing:
npm WARN deprecated core-js#1.2.7: core-js#<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js#3.
npm ERR! code EPROTO
npm ERR! errno EPROTO
npm ERR! request to https://codeload.github.com/expo/react-native/tar.gz/sdk-36.0.0 failed, reason: write EPROTO 4521895360:error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1544:SSL alert number 40
I've installed yarn (v1.21.1) and tried installing using this with the same error:
warning expo > fbemitter > fbjs > core-js#1.2.7: core-js#<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js#3.
error An unexpected error occurred: "https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz: write EPROTO 4356277696:error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1544:SSL alert number 40
Can anyone advise?
I've managed to solve the problem. I was trying to install over my home network, which apparently has some proxy restrictions! No idea why.
Someone advised me to try again but connected to another network or my mobile hotspot. I tried this and it worked! Problem solved. So I guess for any others that may be experiencing the same problem, try connecting to another network and see if that helps.
If this fails, then I suppose looking at the proxy configuration and making changes there may help. But I wouldn't advise doing this unless you know exactly what you're doing.

Xcode / React Native - "Transform Error - unknown plugin 'module-resolver' "

I am running a build on Xcode for my React Native project and for some reason, when running the build in debug mode, this error appears:
'TransformError: [my directory] : Unknown plugin "module-resolver" ' inside my babelrc file.
I tried to npm install the module-resolver to see if that would get rid of the error however the simulator still has as red screen with that same TransformError.
Any help/guidance on this would be really helpful.
Thanks
You must install the 'babel-plugin-module-resolver'.
You should run:
npm install babel-plugin-module-resolver --save-dev
https://www.npmjs.com/package/babel-plugin-module-resolver

Ionic Add Platform EACCES Error

Whenever I use ionic platform add [platformname] It gives me this error
Error: spawn EACCES
at exports._errnoException (util.js:746:11)
at ChildProcess.spawn (child_process.js:1155:11)
at Object.exports.spawn (child_process.js:988:9)
at Object.exports.spawn (/usr/local/lib/node_modules/cordova/node_modules/cordova-
lib/src/cordova/superspawn.js:100:31)
at runScriptViaChildProcessSpawn (/usr/local/lib/node_modules/cordova/node_modules/cordova-
lib/src/hooks/HooksRunner.js:188:23)
at runScript (/usr/local/lib/node_modules/cordova/node_modules/cordova-
lib/src/hooks/HooksRunner.js:131:16)
at /usr/local/lib/node_modules/cordova/node_modules/cordova- lib/src/hooks/HooksRunner.js:114:20
at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)
It seems that the unpacked project has incorrect permissions. This answer suggested to change the permissions of hooks/after_prepare/010_add_platform_class.js to 755. But the solution from the Ioinc forum showed another easy way to solve this -- just run
ionic hooks add
after you create the project and change to your project directory. Then run:
ionic platform add ios
will success without errors.
I was getting a bunch of errors when i emulate the project (iOS). After 1 day. I found with my boss that if you apply "chmod -Rv 755 inside the ionic proyect folder, it's going to work like a charm!.
Steps:
Install node.js, cordova, ionic, iOS-sim
ionic start "project name" "template"
cd "project path"
chmod -Rv 755 * (change permissions inside the project folder scope)
ionic platform add iOS (in this case)
ionic build iOS
ionic emulate iOS
And it will work.
Hope if this helps

Resources