Archiving React Native project fails with PhaseScriptExecution failed with a nonzero exit code. Node in error message doesn't match installed version - react-native

The project was archiving fine before, but after installing yarn globally for a different project, it started failing with the following error:
Node found at: /opt/homebrew/Cellar/node/18.9.0/bin/node
$PROJECT_DIRECTORY/ios/Pods/../../node_modules/react-native/React/FBReactNativeSpec/../../scripts/react_native_pods_utils/script_phases.sh:
line 83: /opt/homebrew/Cellar/node/18.9.0/bin/node: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code
If I run node --version in my terminal, I get back v19.0.1.
I tried running the commands below to try and relink node but I get the same build errors.
sudo rm -f /usr/local/bin/node
sudo ln -s $(which node) /usr/local/bin/node

Figured out my problem. When running pod install for the first time, an .xcode.env.local was auto-generated in the /ios folder with $NODE_BINARY=/opt/homebrew/Cellar/node/18.9.0/bin/node. I updated it to the node version that I have installed, that had been updated when yarn was installed, and it's now working.

Related

zsh: command not found: heroku, after installing through npm

I am trying to install the heroku-cli
I am on mac and I am using npm to install it.
npm install -g heroku
After installing I run the command heroku and the response I receive is:
zsh: command not found: heroku
I have been searching the internet for an answer for way too long now and can not seem to resolve this issue..
I have also downloaded the macOs tarbells and when I open the file, navigate to the bin folder and open the file "heroku" it opens my terminal and display this message.
Even after what looks like it has successfully been installed, when I type heroku --version I still get the command not found.
I am not the most experienced in this field. The reason I am trying to download heroku is because I am doing Fullstack Open.
I just hope it is an easy fix and someone more experienced than me can guide me in the right direction.
I should add I have tried uninstalling and reinstalling multiple times.
SOLUTION FOUND: The solution that helped me was installing homebrew and after installing I ran the command:
brew tap heroku/brew && brew install heroku
heroku command not
npm i -g heroku
zsh: command not found npm:
export NVM_DIR=~/.nvm
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh
zsh: command not
PATH=/bin:/usr/bin:/usr/local/bin:${PATH}
export PATH

Yarn Type Error: "Invalid Number of Spaces"

I have a work project that is configured using yarn. I've used npm commands on other projects for the company, but for this project, I need to use yarn. The reason that I haven't used yarn before is because whenever I run any yarn commands locally, I get the following error:
TypeError: Invalid number of spaces
at tokenise (/usr/local/lib/node_modules/yarn/lib/cli.js:63358:17)
at tokenise.next (<anonymous>)
I'm on a mac and have tried running yarn, brew install yarn,npm install --global yarn and curl --compressed -o- -L https://yarnpkg.com/install.sh | bash. I've also tried npm uninstall yarnand brew uninstall yarn to try to start fresh, but after each attempt at removing and reinstalling, I get the same error.
The cloned repository that I'm working with includes a .yarnrc file and a yarn.lock file. Also, I'm on a work vpn, and have to install dependencies over the vpn, so I have a mirror registry in my .yarnrc file.
Any suggestions on where to start troubleshooting? Obviously, I'm doing something wrong here.

Entry, ":CFBundleIdentifier", Does Not Exist in new react native project

I created a new project with the command react-native init LocationExample --version 0.57.7
It created a project named LocationExample but when I further went into project folder and ran the command react-native run-ios.
This gave an error stating Entry, ":CFBundleIdentifier", Does Not Exist
I have tried removing the build folder by running command rm -rf ios/build and also tried removing the mode modules by rm -rf node_modules. After which i ran yarn command to install the node_modules again but, this had no effect.
Edit1:
/Users/apple/React Native/LocationExample/node_modules/react-native/scripts/ios-install-third-party.sh: line 56: /Users/apple/React/ios-configure-glog.sh: No such file or directory
Command /bin/sh emitted errors but did not return a nonzero exit code to indicate failure
Also this error
'glog/logging.h' file not found
Expected: App should be installed and should run successfully.
Actual: App is not installed and states the error of BundleIdentifier.
Build it in Xcode. If the build is successful then run it in Xcode using Cmd+R
EDIT
Try this
1- Changing the bundle identifier.
2- Adding package:
yarn add #babel/runtime
3-
watchman watch-del-all
4- Removing the build:
rm -rf ios/build
5-
sed -i '' '/DevelopmentTeam = V9WTTPBFK9/d;/DEVELOPMENT_TEAM/d;/ProvisioningStyle = Automatic/d' ./node_modules/react-native/React/React.xcodeproj/project.pbxproj
6-
react-native start --reset-cache
7-
react-native run-ios

vue js app yarn serve is failing with exit code 1.?

I am building frontend of a web app using vuejs. till yesterday my app was running fine but all of sudden today yarn serve command is throwing an error.
Error: watch /home/abhey/Documents/abhey/astrix/astrix_final_project/ecommerceFrontend/public ENOSPC
at _errnoException (util.js:1022:11)
at FSWatcher.start (fs.js:1382:19)
at Object.fs.watch (fs.js:1408:11)
at createFsWatchInstance (/home/abhey/Documents/abhey/astrix/astrix_final_project/ecommerceFrontend/node_modules/chokidar/lib/nodefs-handler.js:37:15)
at setFsWatchListener (/home/abhey/Documents/abhey/astrix/astrix_final_project/ecommerceFrontend/node_modules/chokidar/lib/nodefs-handler.js:80:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/abhey/Documents/abhey/astrix/astrix_final_project/ecommerceFrontend/node_modules/chokidar/lib/nodefs-handler.js:232:14)
at FSWatcher.NodeFsHandler._handleDir (/home/abhey/Documents/abhey/astrix/astrix_final_project/ecommerceFrontend/node_modules/chokidar/lib/nodefs-handler.js:414:19)
at FSWatcher.<anonymous> (/home/abhey/Documents/abhey/astrix/astrix_final_project/ecommerceFrontend/node_modules/chokidar/lib/nodefs-handler.js:462:19)
at FSWatcher.<anonymous> (/home/abhey/Documents/abhey/astrix/astrix_final_project/ecommerceFrontend/node_modules/chokidar/lib/nodefs-handler.js:467:16)
at FSReqWrap.oncomplete (fs.js:153:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I did try to look into the documentation but it was of no use. I also tried to start a new project altogether but it was of no help. any suggestions? if it's of any use I am using Linux Mint 19 as my os.
Well I had the same problem with npm.
You can try to clean the npm cache remove the node module folder and re install the dependencies try this code in your terminal.
cd ~
sudo rm -rf .npm
cd <package folder where node module exist>
npm cache clean
rm -rf node_modules
npm install
try same logic with yarn it will solve your problem.

create-react-app using npx generating error message path not found

After running following command i am getting error
npx create-react-app
"$basedir/../../Users/abc/AppData/Local/Yarn/.global/node_modules/.bin/create-react-app.cmd" "$#"
The system cannot find the path specified.
node and NPM versions
λ node -v
v9.5.0
λ npm -v
5.6.0
After searching and some digging, I finally found the solution. I installed yarn before, so it was mixing something up...
create-react-app command was still working when i completely removed it form my PC.
In short create-react-app.cmd file was reside in ProgramFils\nodjs folder I don't know why/how this file was there. After removing the creat-react-app command file all was set.
I had the same error message. I solved this by using yarn instead of npx:
yarn create react-app [name of app]
Note there is no hyphen between create and react-app