Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b546436113 | ||
|
|
016bc134d5 | ||
|
|
9c25a8f316 | ||
|
|
a954458829 | ||
|
|
09951b49c5 | ||
|
|
3b133fac2f | ||
|
|
6ac8ebafba | ||
|
|
62fb0d0ad6 | ||
|
|
a461a0fffc |
6
.gitignore
vendored
6
.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
|
# gitignore
|
||||||
HEAD
|
HEAD
|
||||||
.cache
|
.cache
|
||||||
v*
|
v*
|
||||||
@@ -15,3 +16,8 @@ npm-debug.log
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
current
|
current
|
||||||
default-packages
|
default-packages
|
||||||
|
|
||||||
|
# Only apps should have lockfiles
|
||||||
|
npm-shrinkwrap.json
|
||||||
|
package-lock.json
|
||||||
|
yarn.lock
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ sudo: required
|
|||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
- ghc
|
|
||||||
- zsh
|
- zsh
|
||||||
# - ksh
|
# - ksh
|
||||||
# - gcc-4.8
|
# - gcc-4.8
|
||||||
@@ -13,7 +12,6 @@ addons:
|
|||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
- $HOME/.npm
|
- $HOME/.npm
|
||||||
- $HOME/.ghc
|
|
||||||
- $TRAVIS_BUILD_DIR/.cache
|
- $TRAVIS_BUILD_DIR/.cache
|
||||||
- $TRAVIS_BUILD_DIR/node_modules
|
- $TRAVIS_BUILD_DIR/node_modules
|
||||||
before_install:
|
before_install:
|
||||||
|
|||||||
22
README.md
22
README.md
@@ -1,4 +1,4 @@
|
|||||||
# Node Version Manager [][3] [][4] [](https://bestpractices.coreinfrastructure.org/projects/684)
|
# Node Version Manager [][3] [][4] [](https://bestpractices.coreinfrastructure.org/projects/684)
|
||||||
|
|
||||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||||
@@ -41,13 +41,13 @@
|
|||||||
To install or update nvm, you can use the [install script][2] using cURL:
|
To install or update nvm, you can use the [install script][2] using cURL:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.5/install.sh | bash
|
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
or Wget:
|
or Wget:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.5/install.sh | bash
|
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
<sub>The script clones the nvm repository to `~/.nvm` and adds the source line to your profile (`~/.bash_profile`, `~/.zshrc`, `~/.profile`, or `~/.bashrc`).</sub>
|
<sub>The script clones the nvm repository to `~/.nvm` and adds the source line to your profile (`~/.bash_profile`, `~/.zshrc`, `~/.profile`, or `~/.bashrc`).</sub>
|
||||||
@@ -127,8 +127,8 @@ If you have `git` installed (requires git v1.7+):
|
|||||||
|
|
||||||
1. clone this repo in the root of your user profile
|
1. clone this repo in the root of your user profile
|
||||||
- `cd ~/` from anywhere then `git clone https://github.com/creationix/nvm.git .nvm`
|
- `cd ~/` from anywhere then `git clone https://github.com/creationix/nvm.git .nvm`
|
||||||
1. check out the latest version with `git checkout v0.33.5`
|
2. `cd ~/.nvm` and check out the latest version with `git checkout v0.33.6`
|
||||||
1. activate nvm by sourcing it from your shell
|
3. activate nvm by sourcing it from your shell: `. nvm.sh`
|
||||||
|
|
||||||
Now add these lines to your `~/.bashrc`, `~/.profile`, or `~/.zshrc` file to have it automatically sourced upon login:
|
Now add these lines to your `~/.bashrc`, `~/.profile`, or `~/.zshrc` file to have it automatically sourced upon login:
|
||||||
(you may have to add to more than one of the above files)
|
(you may have to add to more than one of the above files)
|
||||||
@@ -487,7 +487,7 @@ If installing nvm on Alpine Linux *is* still what you want or need to do, you sh
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
apk add -U curl bash ca-certificates openssl ncurses coreutils python2 make gcc g++ libgcc linux-headers grep util-linux binutils findutils
|
apk add -U curl bash ca-certificates openssl ncurses coreutils python2 make gcc g++ libgcc linux-headers grep util-linux binutils findutils
|
||||||
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.5/install.sh | bash
|
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
The Node project has some desire but no concrete plans (due to the overheads of building, testing and support) to offer Alpine-compatible binaries.
|
The Node project has some desire but no concrete plans (due to the overheads of building, testing and support) to offer Alpine-compatible binaries.
|
||||||
@@ -519,7 +519,7 @@ $ docker run -it nvm-dev -h nvm-dev
|
|||||||
nvm@nvm-dev:~/.nvm$
|
nvm@nvm-dev:~/.nvm$
|
||||||
```
|
```
|
||||||
|
|
||||||
Please note that it'll take about 15 minutes to build the image and the image size would be about 1.2GB, so it's not sutable for production usage.
|
Please note that it'll take about 15 minutes to build the image and the image size would be about 1.2GB, so it's not suitable for production usage.
|
||||||
|
|
||||||
For more information and documentation about docker, please refer to its official website:
|
For more information and documentation about docker, please refer to its official website:
|
||||||
- https://www.docker.com/
|
- https://www.docker.com/
|
||||||
@@ -527,7 +527,7 @@ For more information and documentation about docker, please refer to its officia
|
|||||||
|
|
||||||
## Problems
|
## Problems
|
||||||
|
|
||||||
- If you try to install a node version and the installation fails, be sure to delete the node downloads from src (~/.nvm/src/) or you might get an error when trying to reinstall them again or you might get an error like the following:
|
- If you try to install a node version and the installation fails, be sure to delete the node downloads from src (`~/.nvm/src/`) or you might get an error when trying to reinstall them again or you might get an error like the following:
|
||||||
|
|
||||||
curl: (33) HTTP server doesn't seem to support byte ranges. Cannot resume.
|
curl: (33) HTTP server doesn't seem to support byte ranges. Cannot resume.
|
||||||
|
|
||||||
@@ -539,7 +539,7 @@ For more information and documentation about docker, please refer to its officia
|
|||||||
nvm install -s 0.8.6
|
nvm install -s 0.8.6
|
||||||
```
|
```
|
||||||
|
|
||||||
- If setting the `default` alias does not establish the node version in new shells (i.e. `nvm current` yields `system`), ensure that the system's node PATH is set before the `nvm.sh` source line in your shell profile (see [#658](https://github.com/creationix/nvm/issues/658))
|
- If setting the `default` alias does not establish the node version in new shells (i.e. `nvm current` yields `system`), ensure that the system's node `PATH` is set before the `nvm.sh` source line in your shell profile (see [#658](https://github.com/creationix/nvm/issues/658))
|
||||||
|
|
||||||
## Mac OS "troubleshooting"
|
## Mac OS "troubleshooting"
|
||||||
|
|
||||||
@@ -554,8 +554,8 @@ sudo chmod ugo-x /usr/libexec/path_helper
|
|||||||
More on this issue in [dotphiles/dotzsh](https://github.com/dotphiles/dotzsh#mac-os-x).
|
More on this issue in [dotphiles/dotzsh](https://github.com/dotphiles/dotzsh#mac-os-x).
|
||||||
|
|
||||||
[1]: https://github.com/creationix/nvm.git
|
[1]: https://github.com/creationix/nvm.git
|
||||||
[2]: https://github.com/creationix/nvm/blob/v0.33.5/install.sh
|
[2]: https://github.com/creationix/nvm/blob/v0.33.6/install.sh
|
||||||
[3]: https://travis-ci.org/creationix/nvm
|
[3]: https://travis-ci.org/creationix/nvm
|
||||||
[4]: https://github.com/creationix/nvm/releases/tag/v0.33.5
|
[4]: https://github.com/creationix/nvm/releases/tag/v0.33.6
|
||||||
[Urchin]: https://github.com/scraperwiki/urchin
|
[Urchin]: https://github.com/scraperwiki/urchin
|
||||||
[Fish]: http://fishshell.com
|
[Fish]: http://fishshell.com
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ nvm_install_dir() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
nvm_latest_version() {
|
nvm_latest_version() {
|
||||||
echo "v0.33.5"
|
echo "v0.33.6"
|
||||||
}
|
}
|
||||||
|
|
||||||
nvm_profile_is_bash_or_zsh() {
|
nvm_profile_is_bash_or_zsh() {
|
||||||
@@ -330,9 +330,12 @@ nvm_do_install() {
|
|||||||
BASH_OR_ZSH=false
|
BASH_OR_ZSH=false
|
||||||
|
|
||||||
if [ -z "${NVM_PROFILE-}" ] ; then
|
if [ -z "${NVM_PROFILE-}" ] ; then
|
||||||
echo "=> Profile not found. Tried ${NVM_PROFILE} (as defined in \$PROFILE), ~/.bashrc, ~/.bash_profile, ~/.zshrc, and ~/.profile."
|
local TRIED_PROFILE
|
||||||
|
if [ -n "${PROFILE}" ]; then
|
||||||
|
TRIED_PROFILE="${NVM_PROFILE} (as defined in \$PROFILE), "
|
||||||
|
fi
|
||||||
|
echo "=> Profile not found. Tried ${TRIED_PROFILE-}~/.bashrc, ~/.bash_profile, ~/.zshrc, and ~/.profile."
|
||||||
echo "=> Create one of them and run this script again"
|
echo "=> Create one of them and run this script again"
|
||||||
echo "=> Create it (touch ${NVM_PROFILE}) and run this script again"
|
|
||||||
echo " OR"
|
echo " OR"
|
||||||
echo "=> Append the following lines to the correct file yourself:"
|
echo "=> Append the following lines to the correct file yourself:"
|
||||||
command printf "${SOURCE_STR}"
|
command printf "${SOURCE_STR}"
|
||||||
|
|||||||
13
nvm.sh
13
nvm.sh
@@ -206,12 +206,21 @@ nvm_install_latest_npm() {
|
|||||||
nvm_echo '* `npm` v5 and higher do not work on `node` versions below v4.0.0'
|
nvm_echo '* `npm` v5 and higher do not work on `node` versions below v4.0.0'
|
||||||
$NVM_NPM_CMD install -g npm@4
|
$NVM_NPM_CMD install -g npm@4
|
||||||
elif [ $NVM_IS_0_9 -eq 0 ] && [ $NVM_IS_0_6 -eq 0 ]; then
|
elif [ $NVM_IS_0_9 -eq 0 ] && [ $NVM_IS_0_6 -eq 0 ]; then
|
||||||
if nvm_version_greater 4.5.0 "${NODE_VERSION}" || (\
|
local NVM_IS_4_4_OR_BELOW
|
||||||
|
NVM_IS_4_4_OR_BELOW=0
|
||||||
|
if nvm_version_greater 4.5.0 "${NODE_VERSION}"; then
|
||||||
|
NVM_IS_4_4_OR_BELOW=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if $NVM_IS_4_4_OR_BELOW -eq 1 || (\
|
||||||
nvm_version_greater_than_or_equal_to "${NODE_VERSION}" 5.0.0 \
|
nvm_version_greater_than_or_equal_to "${NODE_VERSION}" 5.0.0 \
|
||||||
&& nvm_version_greater 5.10.0 "${NODE_VERSION}"\
|
&& nvm_version_greater 5.10.0 "${NODE_VERSION}"\
|
||||||
); then
|
); then
|
||||||
nvm_echo '* `npm` `v5.3.x` is the last version that works on `node` 4.x versions below v4.4, or 5.x versions below v5.10, due to `Buffer.alloc`'
|
nvm_echo '* `npm` `v5.3.x` is the last version that works on `node` 4.x versions below v4.4, or 5.x versions below v5.10, due to `Buffer.alloc`'
|
||||||
$NVM_NPM_CMD install -g npm@5.3
|
$NVM_NPM_CMD install -g npm@5.3
|
||||||
|
elif $NVM_IS_4_4_OR_BELOW -eq 0 && nvm_version_greater 4.7.0 "${NODE_VERSION}"; then
|
||||||
|
nvm_echo '* `npm` `v5.4.x` is the last version that works on `node` `v4.5` and `v4.6`'
|
||||||
|
$NVM_NPM_CMD install -g npm@5.4
|
||||||
else
|
else
|
||||||
nvm_echo '* Installing latest `npm`; if this does not work on your node version, please report a bug!'
|
nvm_echo '* Installing latest `npm`; if this does not work on your node version, please report a bug!'
|
||||||
$NVM_NPM_CMD install -g npm
|
$NVM_NPM_CMD install -g npm
|
||||||
@@ -3378,7 +3387,7 @@ nvm() {
|
|||||||
NVM_VERSION_ONLY=true NVM_LTS="${NVM_LTS-}" nvm_remote_version "${PATTERN:-node}"
|
NVM_VERSION_ONLY=true NVM_LTS="${NVM_LTS-}" nvm_remote_version "${PATTERN:-node}"
|
||||||
;;
|
;;
|
||||||
"--version" )
|
"--version" )
|
||||||
nvm_echo '0.33.5'
|
nvm_echo '0.33.6'
|
||||||
;;
|
;;
|
||||||
"unload" )
|
"unload" )
|
||||||
nvm deactivate >/dev/null 2>&1
|
nvm deactivate >/dev/null 2>&1
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "nvm",
|
"name": "nvm",
|
||||||
"version": "0.33.5",
|
"version": "0.33.6",
|
||||||
"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"
|
||||||
|
|||||||
Reference in New Issue
Block a user