Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

npm shortcut #75

Closed
pthrasher opened this Issue · 8 comments

4 participants

@pthrasher

Hey guys,

The below sh snippet will make npm always work, and always be the current version. I'd like to add this to the readme, but wasn't sure what section / etc would be preferable. I'm putting this here both as a reference, and for us to discuss. I'll submit a pull request if @visionmedia can let me know where to put it, or if he'd like to put it in there, etc.

function npm() {
    active=$(node --version);
    active=${active#v};
    n npm $active $@
}
@tj
Owner
tj commented

yeah we just need to install npm properly when you n <version>

@pthrasher

What's your current workaround for this within your own workflow?

@jenius

+100 for this, this shortcut just saved my life

@pthrasher

Glad I could help. :-)

@tj
Owner
tj commented

i cant remember if we fixed npm installs haha, I've just installed node directly the last few times, but I guess my point is that you shouldn't need this at all

@pthrasher

Ahh, I see. Well, for whatever reason, I did... And this make npm always do the right thing.

@tj tj closed this
@untoldone

Just curious: Why was this closed if the work around didn't actually make it into the documentation/ no action was taken? At the very least a short explanation as to the rational for closing (all the tickets related to this topic) would be nice... I really appreciate n's usability compared to say nvm ... but this makes me think twice about it.

@tj
Owner
tj commented

npm is installed along with the rest of node, if not then it's a bug, works fine for me though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.