Compare commits

..

6 Commits

Author SHA1 Message Date
Jordan Harband
29f582611b v0.6.1 2014-05-04 12:40:02 -07:00
Jordan Harband
673cda56c4 Adding a test for nvm install invalid behavior, and correcting the message.
From f00d688c87 (commitcomment-6205164)
2014-05-04 12:03:26 -07:00
Jordan Harband
e562a5645b v0.6.0 2014-05-04 02:20:31 -07:00
Jordan Harband
c0c5e8d7ef Editing README to note improved .nvmrc behavior. 2014-05-04 02:20:24 -07:00
Jordan Harband
f00d688c87 Nicer failure message when trying to install an invalid version. Fixes #285. 2014-05-04 00:59:08 -07:00
Jordan Harband
5aa78f21cf Merge branch 'nvmrc' - Fixes #404 2014-05-04 00:47:16 -07:00
4 changed files with 21 additions and 10 deletions

View File

@@ -8,11 +8,11 @@ First you'll need to make sure your system has a c++ compiler. For OSX, XCode w
To install you could use the [install script][2] using cURL:
curl https://raw.githubusercontent.com/creationix/nvm/v0.5.1/install.sh | sh
curl https://raw.githubusercontent.com/creationix/nvm/v0.6.1/install.sh | sh
or Wget:
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.5.1/install.sh | sh
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.6.1/install.sh | sh
<sub>The script clones the nvm repository to `~/.nvm` and adds the source line to your profile (`~/.bash_profile`, `~/.zshrc` or `~/.profile`).</sub>
@@ -37,6 +37,9 @@ Often I also put in a line to use a specific version of node.
## Usage
You can create an `.nvmrc` file containing version number in the project root directory (or any parent directory).
`nvm use`, `nvm install`, and `nvm run` will all respect an `.nvmrc` file.
To download, compile, and install the latest v0.10.x release of node, do this:
nvm install 0.10
@@ -45,13 +48,9 @@ And then in any new shell just use the installed version:
nvm use 0.10
You can create an `.nvmrc` file containing version number in the project root folder; run the following command to switch versions:
nvm use
Or you can just run it:
nvm run 0.10
nvm run 0.10 --version
If you want to see what versions are installed:
@@ -164,7 +163,7 @@ After the v0.8.6 release of node, nvm tries to install from binary packages. But
nvm install -s 0.8.6
[1]: https://github.com/creationix/nvm.git
[2]: https://github.com/creationix/nvm/blob/v0.5.1/install.sh
[2]: https://github.com/creationix/nvm/blob/v0.6.1/install.sh
[3]: https://travis-ci.org/creationix/nvm
[Urchin]: https://github.com/scraperwiki/urchin

7
nvm.sh
View File

@@ -308,6 +308,11 @@ nvm() {
[ -d "$NVM_DIR/$VERSION" ] && echo "$VERSION is already installed." && return
if [ "$VERSION" = "N/A" ]; then
echo "Version '$provided_version' not found - try \`nvm ls-remote\` to browse available versions."
return 3
fi
# skip binary install if no binary option specified.
if [ $nobinary -ne 1 ]; then
# shortcut - try the binary if possible.
@@ -611,7 +616,7 @@ nvm() {
nvm_version $2
;;
"--version" )
echo "nvm v0.5.1"
echo "nvm v0.6.1"
;;
* )
nvm help

View File

@@ -1,6 +1,6 @@
{
"name": "nvm",
"version": "0.5.1",
"version": "0.6.1",
"description": "Node Version Manager - Simple bash script to manage multiple active node.js versions",
"directories": {
"test": "test"

View File

@@ -0,0 +1,7 @@
#!/bin/sh
die () { echo $@ ; exit 1; }
. ../../nvm.sh
[ "$(nvm install invalid.invalid)" = "Version 'invalid.invalid' not found - try \`nvm ls-remote\` to browse available versions." ] || die "nvm installing an invalid version did not print a nice error message"