12

Homebrew and the Node download page install node.js in different locations that apparently conflict. Brew will complain after a 'brew doctor' if both locations are used.

So, is there a preferred way to put node on my Mac(Yosemite 10.10.5).

This is what I'm getting now while attempting to install node via brew.

node-4.1.0 already installed, it's just not linked
DONs-iMac:Erlang-Elixir donfox1$ brew link node
Linking /usr/local/Cellar/node/4.1.0... 
Error: Could not symlink share/systemtap/tapset/node.stp
/usr/local/share/systemtap/tapset is not writable.
1

7 Answers 7

10

sudo chown -R $USER /usr/local/share/ brew doctor brew install node

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

Comments

3

Have you tried chmoding 755 /usr/local/share/systemtap/tapset so it is writable? That could fix it?

chmod 755 /usr/local/share/systemtap/tapset
brew link node 

Also try this if it does not work (may work):

brew cleanup
brew link node
brew uninstall node
brew install node

3 Comments

I did the above and still have the same issue. The permissions on tapes, an empty directory is: drwxr-xr-x 2 root admin 68 Sep 21 16:00 tapset. Still it is unwritable?
Okay then do chmod 777 and revert back to 755 once it's done the install.
Remove folder sudo rm -rf /usr/local/share/systemtap/, uninstall node brew uninstall node, reinstall node brew install node, create symlinks brew link node
2

If you are not sure about what version of node you need now and potentially need in the future I would also reccomend to install NVM - node version manager.
Download the nvm install script via cURL:

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash

Ensure that nvm was installed correctly with nvm --version, which should return the version of nvm installed.
Install the version of Node.js you want
Install the latest version with nvm install node
Use the latest version with nvm use node
Install the latest LTS version with nvm install --lts
Use the latest LTS verison with nvm use --lts

You can also check the tutorials:
installing-node-js-tutorial-using-nvm-on-mac-os-x-and-ubuntu
Best way to install and use nvm on Mac

1 Comment

Also they seem to have precompiled binaries whereas brew does not so installation is much faster.
2
  1. curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

  2. nvm install 20

Read this doc: https://nodejs.org/en/download/package-manager

Comments

1

Uninstall node: sudo rm -rf /usr/local/share/systemtap/ && brew uninstall node and install nvm with brew - so you can control you node versions. Read this article: suggested way to install npm with brew

1 Comment

just uninstall node if it was installed by brew. no need to uninstall brew, itself
0

Simply GO HERE

https://nodejs.org/en/download

and that system dynamically determines exactly what to do based on your laptop OS, current versions etc.

Comments

0

Node.js official download page has clear instructions and commands to install node.js using nvm.

# Download and install nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash

# in lieu of restarting the shell
\. "$HOME/.nvm/nvm.sh"

# Download and install Node.js:
nvm install 22

# Verify the Node.js version:
node -v # Should print "v22.16.0".

nvm current # Should print "v22.16.0".

# Verify npm version:
npm -v # Should print "10.9.2".

NOTE: Please visit the download link (https://nodejs.org/en/download) for the commands and instructions to download and install the latest version of Node.js.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.