Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
29f582611b | ||
|
|
673cda56c4 | ||
|
|
e562a5645b | ||
|
|
c0c5e8d7ef | ||
|
|
f00d688c87 | ||
|
|
5aa78f21cf |
@@ -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:
|
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:
|
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>
|
<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
|
## 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:
|
To download, compile, and install the latest v0.10.x release of node, do this:
|
||||||
|
|
||||||
nvm install 0.10
|
nvm install 0.10
|
||||||
@@ -45,13 +48,9 @@ And then in any new shell just use the installed version:
|
|||||||
|
|
||||||
nvm use 0.10
|
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:
|
Or you can just run it:
|
||||||
|
|
||||||
nvm run 0.10
|
nvm run 0.10 --version
|
||||||
|
|
||||||
If you want to see what versions are installed:
|
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
|
nvm install -s 0.8.6
|
||||||
|
|
||||||
[1]: https://github.com/creationix/nvm.git
|
[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
|
[3]: https://travis-ci.org/creationix/nvm
|
||||||
[Urchin]: https://github.com/scraperwiki/urchin
|
[Urchin]: https://github.com/scraperwiki/urchin
|
||||||
|
|
||||||
|
|||||||
7
nvm.sh
7
nvm.sh
@@ -308,6 +308,11 @@ nvm() {
|
|||||||
|
|
||||||
[ -d "$NVM_DIR/$VERSION" ] && echo "$VERSION is already installed." && return
|
[ -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.
|
# skip binary install if no binary option specified.
|
||||||
if [ $nobinary -ne 1 ]; then
|
if [ $nobinary -ne 1 ]; then
|
||||||
# shortcut - try the binary if possible.
|
# shortcut - try the binary if possible.
|
||||||
@@ -611,7 +616,7 @@ nvm() {
|
|||||||
nvm_version $2
|
nvm_version $2
|
||||||
;;
|
;;
|
||||||
"--version" )
|
"--version" )
|
||||||
echo "nvm v0.5.1"
|
echo "nvm v0.6.1"
|
||||||
;;
|
;;
|
||||||
* )
|
* )
|
||||||
nvm help
|
nvm help
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "nvm",
|
"name": "nvm",
|
||||||
"version": "0.5.1",
|
"version": "0.6.1",
|
||||||
"description": "Node Version Manager - Simple bash script to manage multiple active node.js versions",
|
"description": "Node Version Manager - Simple bash script to manage multiple active node.js versions",
|
||||||
"directories": {
|
"directories": {
|
||||||
"test": "test"
|
"test": "test"
|
||||||
|
|||||||
7
test/fast/Running "nvm install" with an invalid version fails nicely
Executable file
7
test/fast/Running "nvm install" with an invalid version fails nicely
Executable 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"
|
||||||
|
|
||||||
Reference in New Issue
Block a user