can't brew install node

后端 未结 12 945
无人及你
无人及你 2020-12-13 06:35

I am trying to upgrade my node via homebrew but ran into a problem because I think I tried to download through the website. I am very new to terminal. I\'ve tried to search

相关标签:
12条回答
  • 2020-12-13 06:57

    If you try to brew link node and it says something along the lines:

    Error: Could not symlink include/node/openssl/archs/aix-gcc/asm/include/openssl/opensslconf.h Target /usr/local/include/node/openssl/archs/aix-gcc/asm/include/openssl/opensslconf.h already exists. You may want to remove it:

    Try this:

    brew link --overwrite --dry-run node | xargs rm
    brew link node 
    
    0 讨论(0)
  • 2020-12-13 07:01

    I ran into this problem on a new MacBook Pro on Mac OS High Sierra. I gleaned brew was trying to use directories named include and lib under /usr/local that was not there. Since root owns /usr I had to do it manually - making sure that whoami owner matches peer directories in /usr/local:

    sudo mkdir /usr/local/include
    chown `whoami`:admin /usr/local/include 
    sudo mkdir /usr/local/lib
    chown `whoami`:admin /usr/local/lib
    

    And then to match the other directories in /usr/local I did:

    chmod 775 /usr/local/include
    chmod 775 /usr/local/lib
    

    then the following worked:

    brew uninstall node 
    brew install node
    
    0 讨论(0)
  • 2020-12-13 07:01

    brew postinstall node or brew link --overwrite node doesn't seem to help.

    After several rounds of brew uninstall node and brew install node the following were the offending directories and files:

    sudo rm -r /usr/local/include/node
    sudo rm -r /usr/local/share/doc/node
    sudo rm -r /usr/local/lib/node_modules
    sudo rm /usr/local/lib/dtrace/node.d
    sudo rm /usr/local/share/man/man1/node.1
    sudo rm /usr/local/share/systemtap/tapset/node.stp
    

    After the offending files are removed brew will do all the proper linking with permissions for you.

    Likely permissions were set as root:wheel because of a past install with sudo or perhaps manual installation, etc.

    0 讨论(0)
  • 2020-12-13 07:02

    remove the error folder or file manually and run this command brew uninstall node && brew install node

    You have to do this process till all error folder and files are removed.

    Then node will be linked.

    0 讨论(0)
  • 2020-12-13 07:04

    I ran into this same issue under the same circumstances. I was able to get the brew version to install successfully by:

    1. Run brew install node
    2. Make note of the module that is causing the issue and delete it. In your case, this would be /usr/local/include/node
    3. Uninstall - brew uninstall node
    4. Re-install - brew install node

    I had to repeat this process a few times for each remaining problematic directory (about 3 different ones in actuality), and the install eventually succeeded without any issues.

    0 讨论(0)
  • 2020-12-13 07:10
    brew link --overwrite node
    

    Error: Could not symlink (...)

    /usr/xxx

    sudo chown -R 'whoami?':admin xxx
    brew link --overwrite node
    

    Rinse and repeat

    0 讨论(0)
提交回复
热议问题