React Native ios build : Can't find node

后端 未结 4 771
无人共我
无人共我 2020-12-30 03:37

I have a prototype ready to go and the project is jammed with build:

error: Can\'t find \'node\' binary to build React Native bundle If you have non

相关标签:
4条回答
  • 2020-12-30 04:13

    Open Xcode, then choose "Preferences..." from the Xcode menu.

    Go to the Locations panel and install the tools by selecting the most recent version in the Command Line Tools dropdown.

    select command line tools like as this image

    0 讨论(0)
  • 2020-12-30 04:14

    The solution for me is to set a default version of node with nvm in your profile. This works for bash or zsh:

    Add this to your .zshrc or .bashrc

    # default node version for nvm
    nvm use 8.9.3
    

    Be sure to change it to the version you want when starting a new terminal.

    0 讨论(0)
  • 2020-12-30 04:21

    I found one solution

    First find your current node, in shell

    which node
    

    then copy your node url to

    export NODE_BINARY=[your node path]
    ../node_modules/react-native/packager/react-native-xcode.sh to node_modules/react-native/scripts/react-native-xcode.sh
    

    0 讨论(0)
  • 2020-12-30 04:27

    @brunocascio solution on the comment is simpler and less invasive, create a symlink to node, on command line:

    ln -s $(which node) /usr/local/bin/node
    
    0 讨论(0)
提交回复
热议问题