3

I deleted nvm from my mac (I deleted the ~/.nvm-folder), and I installed node through the installer from their website.

I have a React Native project I want to build in XCode, but I get the following error:

Node found at: /Users/username/.nvm/versions/node/v18.19.1/bin/node
/Users/username/Library/Developer/Xcode/DerivedData/app-gnvlyyajukhnelhalqtfeuwftjrn/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/hermes-engine.build/Script-46EB2E0002AB40.sh: line 9: /Users/username/.nvm/versions/node/v18.19.1/bin/node: No such file or directory

I think somewhere in XCode/my project, the old path of node (nvm) is still persisted. What I did so far:

  1. added export NODE_BINARY=/usr/local/bin/node to .zshrc -> didn't work
  2. deleted node_modules, deleted pods, ... -> didn't work
  3. deleted the derivedData folder of XCode -> didn't work
  4. set a symlink to /usr/local/bin/node -> this symlink already exists, didn't work

Where to set this node path?

1

1 Answer 1

6

There is a environment for local saved at react-native-project/ios/.xcode.env.local:

export NODE_BINARY=/Users/mac/.nvm/versions/node/[old version]/bin/node

Edit the version number:

export NODE_BINARY=/Users/mac/.nvm/versions/node/v20.15.1/bin/node

If you want to know the current version number, then check current node path by type command -v node on terminal:

reference: React Native - FBReactNativeSpec Command PhaseScriptExecution failed with a nonzero exit code

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.