Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Point xcode to correct node version

I usually do not have any issues with nvm, but a React Native / Xcode project is failing to build because it's trying to use Node v4.4.3.

My nvm ls looks like this:

   v5.11.0
   v5.11.1
   v6.1.0
   v6.9.5
   v6.11.5
-> v8.7.0
   v10.1.0
   system

When I type nvm use system and node -v it prints 4.4.3, so I suppose that's where Xcode is getting 4.4.3 from.

But when I type nvm alias system 8.7.0 (attempting to alias the system to 8.7.0), it prints system -> 8.7.0 (-> v8.7.0) and node -v still returns 4.4.3. I also tried nvm install 8.7.0 --reinstall-packages-from=node, but that didn't really seem to do anything to help the cause.

I probably had node installed with brew at one point, but believe I've installed it because brew node -v returns Error: Unknown command: node Error: Kernel.exit.

Wondering if anyone can point me in the correct direction!

like image 870
0xPingo Avatar asked Oct 21 '25 13:10

0xPingo


2 Answers

. ~/.nvm/nvm.sh at the top of the shell script in Build Phases did the trick.

like image 72
0xPingo Avatar answered Oct 23 '25 03:10

0xPingo


Try this answer: https://stackoverflow.com/a/11298299/8723007

I also installed node with brew at some point which I just forgot about it because I also use nvm.

:facepalm:

Try $ brew upgrade node in Terminal and if that doesn't work trying installing node with homebrew anyway. You should get the system version to be the most up to date. As of rn that's version 11.

like image 37
valem Avatar answered Oct 23 '25 04:10

valem