Nvm: cannot run nvm from npm start

Created on 2 Nov 2015  路  11Comments  路  Source: nvm-sh/nvm

captura de pantalla 2015-11-01 a las 8 28 05 p m

trying to run "nvm run stable server.js" from npm scripts
captura de pantalla 2015-11-01 a las 8 31 35 p m
i installed nvm from curl, not using npm install nvm

non-issue / invalid

Most helpful comment

For others that my stumble upon this issue: nvm can be used in the 'start' option in the "scripts" part of your package.json file, if you source the nvm.sh file as part of the command line. So you can do something like this:
"start": "source ~/.nvm/nvm.sh; nvm use stable; node yourapp.js"

And your app should start up just fine without the error described in this issue.

All 11 comments

If you're getting that nvm-help error, then you definitely have the npm (wrong) version of nvm. Try npm uninstall -g nvm?

@ljharb so it's not possible to install nvm via npm?

@dkfiresky npm requires node. what kind of sense does it make to install an X version manager with a tool that requires X? :-)

@ljharb what is the purpose of publishing this package over npm than? And why I'm able to install it over npm?

@dkfiresky see #304 for background - basically, because anyone can publish anything to npm, someone published a package named "nvm" that isn't this one. They graciously added me as an owner, so at some point in the future, I'll replace it with something more useful, but you'll note if you install it over npm, it gives you a deprecation warning directing you to this repository.

For others that my stumble upon this issue: nvm can be used in the 'start' option in the "scripts" part of your package.json file, if you source the nvm.sh file as part of the command line. So you can do something like this:
"start": "source ~/.nvm/nvm.sh; nvm use stable; node yourapp.js"

And your app should start up just fine without the error described in this issue.

For others that my stumble upon this issue: nvm can be used in the 'start' option in the "scripts" part of your package.json file, if you source the nvm.sh file as part of the command line. So you can do something like this:
"start": "source ~/.nvm/nvm.sh; nvm use stable; node yourapp.js"

And your app should start up just fine without the error described in this issue.

Or if source is not available:

{
  "start": ". ~/.nvm/nvm.sh; nvm use stable; node yourapp.js"
}

Thanks @john3exonets and @ikbelkirasan for taking the time to leave helpful information that does not ooze disdain, or attempt to make yourself look smarter by putting someone else down because they don't know some small fact about some tool. Your effort is appreciated.

@chriswood that kind of passive-aggressive comment isn't welcome here; I'm sorry that you misunderstood a joking comment as an attempt to put someone down, but that's what a :-p means in the social contract. I'll hide both our comments, but please keep that in mind for the future.

That's an understandable feeling, but that was not really directed towards you, though I don't think anyone reading text in a post will automatically know that a smiley means that something like " npm requires node. what kind of sense does it make to install an X version manager with a tool that requires X? :-)" is not meant as a "you should have known this, like I do" type comment.
I can definitely see how it looks like I meant it towards you alone, and that is immature and I apologize for that, period. It is a reaction to something I have seen in droves on github. It is something that leads to people quitting software development. There are people in rural counties, I'm sure all over but i refer to some groups we have in Tennessee and Florida, looking to find placement as junior level developers, almost always with a front end job which these days is often node.js based, that I care a lot about. These people are often not exposed to tech in all forms nearly as much as I am, and they are very quick to get overwhelmed or feel that they "just can't get it". I have caused that much more that others, and I don't claim to be good at helping. I try though. The truth is they can, and they can do quite a lot of work for companies. They may start out doing super complicated things but web layout is well within their starting skillset. Deciphering the intricacies of nvm, npm, node, bash, ES6, etc... gets confusing fast and they google things and end up at forums that are likely not where they probably need to be, and often the best outcome is they are ignored, but a lot of times they get spoken to like they somehow should know a certain thing or toolchain, when they shouldn't. They just need to know what it is they need to learn. Worst case they get frustrated and go back to the printing press or the transformer factory or whatever and slog it out. That makes me really sad. This morning after i read several replies on various forums that i felt were not voiced with a respectful tone, or even close, again something that I myself am very guilty of at work, I was frustrated and when i saw these two people had replied to something that was closed I made a comment about it that was smartassy in tone itself. Yours was not anywhere near as bad as some and I should not have commented in this manner. Especially since it was born more from other people's voicing, and not yours. I apologize for that.
chris wood

@chriswood I certainly think that most people seeing a smiley face would realize the statement is meant in good humor.

I completely agree that exclusionary condescension is a real problem, and I appreciate your apology as well as the intention you originally commented with.

Was this page helpful?
0 / 5 - 0 ratings