This repository has been archived by the owner. It is now read-only.

brew npm install does not add /usr/local/share/npm/bin to the PATH #21627

Closed
ssbarnea opened this Issue Aug 3, 2013 · 6 comments

Comments

Projects
None yet
4 participants
@ssbarnea

ssbarnea commented Aug 3, 2013

Clearly, brew is not able to detect when someone is installing something with npm and it shouldn't.

Still, brew should add the npm binary directory (/usr/local/share/npm/bin) to the PATH and ask people to restart the shell, otherwise we will still see more and more bug reports.

This can be fixed by appending this to .bashrc:

MYPATH=/usr/local/share/npm/bin
  if [[ ! ":$PATH:" == *":$MYPATH:"* ]] && [ -d "$MYPATH" ]; then
      export PATH=$PATH:${MYPATH}
  fi
unset MYPATH
@mistydemeo

This comment has been minimized.

Show comment
Hide comment
@mistydemeo

mistydemeo Aug 3, 2013

Contributor

Homebrew doesn't modify the user's environment or dotfiles. However, brew install node does print a message suggesting the user add that path to their PATH.

Contributor

mistydemeo commented Aug 3, 2013

Homebrew doesn't modify the user's environment or dotfiles. However, brew install node does print a message suggesting the user add that path to their PATH.

@mistydemeo mistydemeo closed this Aug 3, 2013

@ssbarnea

This comment has been minimized.

Show comment
Hide comment
@ssbarnea

ssbarnea Aug 3, 2013

This means that the user experience.... is less than optimal in this case. Any installation can be considered incomplete if the tool is not drectly available to the user as it should be. Maybe not the best comparision, but still, if I would compare brew with msi, is like having windows installers that install applications into programfiles without creating start-menu entries.

I am surprised about this decision especially from a product made for OS X, where end-to-end experience do matter a lot.

I am aware that a decision like this would not be made here, but I need to make this visible for people that may not see it. I already fixed the problem myself on my machine, that's not the point. The point is that everyone would have to do the same...

ssbarnea commented Aug 3, 2013

This means that the user experience.... is less than optimal in this case. Any installation can be considered incomplete if the tool is not drectly available to the user as it should be. Maybe not the best comparision, but still, if I would compare brew with msi, is like having windows installers that install applications into programfiles without creating start-menu entries.

I am surprised about this decision especially from a product made for OS X, where end-to-end experience do matter a lot.

I am aware that a decision like this would not be made here, but I need to make this visible for people that may not see it. I already fixed the problem myself on my machine, that's not the point. The point is that everyone would have to do the same...

@jacknagel

This comment has been minimized.

Show comment
Hide comment
@jacknagel

jacknagel Aug 3, 2013

Contributor

/usr/local/share/npm/bin is used if it already exists, but "fresh" installs of node will link npm-installed executables into /usr/local/bin.

So if you're willing to reinstall stuff, you can blow away the existing node/npm install (including /usr/local/share/npm).

Contributor

jacknagel commented Aug 3, 2013

/usr/local/share/npm/bin is used if it already exists, but "fresh" installs of node will link npm-installed executables into /usr/local/bin.

So if you're willing to reinstall stuff, you can blow away the existing node/npm install (including /usr/local/share/npm).

@ssbarnea

This comment has been minimized.

Show comment
Hide comment
@ssbarnea

ssbarnea Aug 4, 2013

Is this a change made in the last 2-3 days? I did not had npm before that and still end-up with this case. If you made any recent changes, I will be glad to test them. Thanks.

ssbarnea commented Aug 4, 2013

Is this a change made in the last 2-3 days? I did not had npm before that and still end-up with this case. If you made any recent changes, I will be glad to test them. Thanks.

@jacknagel

This comment has been minimized.

Show comment
Hide comment
@jacknagel

jacknagel Aug 4, 2013

Contributor

The change was made here: f88d5b8

Contributor

jacknagel commented Aug 4, 2013

The change was made here: f88d5b8

@ryanbillingsley ryanbillingsley referenced this issue in remy/nodemon May 5, 2014

Closed

OSX Nodemon not in Path #190

@MikeMcQuaid

This comment has been minimized.

Show comment
Hide comment
@MikeMcQuaid

MikeMcQuaid Sep 10, 2014

Member

Don't use sudo brew postinstall

Member

MikeMcQuaid commented Sep 10, 2014

Don't use sudo brew postinstall

@MikeMcQuaid MikeMcQuaid locked and limited conversation to collaborators Sep 10, 2014

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.