------------------------------------------------------------
commit 76d6b9870c619d9393ba5c2e3e35fdda171e9773
Author: Helber Belmiro <helber.belmiro@gmail.com>
Date: Wed May 29 17:50:34 2024 -0300
Fixed broken link (#803)
diff --git a/README.md b/README.md
index 2487d17..c7dbff9 100644
--- a/README.md
+++ b/README.md
@@ -90,7 +90,7 @@ As a result, both `n` itself and all Node.js versions it manages are hosted insi
### Replacing a previous node install
-Changing from a previous Node.js installed to a different location may involve a few extra steps. See docs for [changing node location]((./docs/changing-node-location.md)) for a walk-through example of switching from using Homebrew to using `n` to manage Node.js.
+Changing from a previous Node.js installed to a different location may involve a few extra steps. See docs for [changing node location](./docs/changing-node-location.md) for a walk-through example of switching from using Homebrew to using `n` to manage Node.js.
You have a problem with multiple versions if after installing node you see the "installed" and "active" locations are different:
```console
------------------------------------------------------------
commit a07ed85c6aaa126f4cbba90f84c774b289de485f
Author: John Gee <john@ruru.gen.nz>
Date: Sat May 11 16:18:53 2024 +1200
Docs for switching node directory (#802)
diff --git a/README.md b/README.md
index b9310a7..2487d17 100644
--- a/README.md
+++ b/README.md
@@ -13,6 +13,7 @@ Node.js version management: no subshells, no profile setup, no convoluted API, j
- [Supported Platforms](#supported-platforms)
- [Installation](#installation)
- [Third Party Installers](#third-party-installers)
+ - [Replacing a previous node install](#replacing-a-previous-node-install)
- [Installing Node.js Versions](#installing-nodejs-versions)
- [Specifying Node.js Versions](#specifying-nodejs-versions)
- [Removing Versions](#removing-versions)
@@ -87,6 +88,18 @@ n-install sets both `PREFIX` and `N_PREFIX` to `$HOME/n`, installs `n` to `$HOME
As a result, both `n` itself and all Node.js versions it manages are hosted inside a single, optionally configurable directory, which you can later remove with the included `n-uninstall` script. `n-update` updates `n` itself to the latest version. See the [n-install repo](https://github.com/mklement0/n-install) for more details.
+### Replacing a previous node install
+
+Changing from a previous Node.js installed to a different location may involve a few extra steps. See docs for [changing node location]((./docs/changing-node-location.md)) for a walk-through example of switching from using Homebrew to using `n` to manage Node.js.
+
+You have a problem with multiple versions if after installing node you see the "installed" and "active" locations are different:
+```console
+% n lts
+ copying : node/20.12.2
+ installed : v20.12.2 to /usr/local/bin/node
+ active : v21.7.3 at /opt/homebrew/bin/node
+```
+
## Installing Node.js Versions
Simply execute `n <version>` to download and install a version of Node.js. If `<version>` has already been downloaded, `n` will install from its cache.
diff --git a/docs/changing-node-location.md b/docs/changing-node-location.md
new file mode 100644
index 0000000..ef333db
--- /dev/null
+++ b/docs/changing-node-location.md
@@ -0,0 +1,115 @@
+# Switching To `n` Managed Node.js
+
+If you already have Node.js installed to a different root than `n` uses, you can easily end up with multiple copies of node (and npm, and npx, and globally installed packages!). Some common situations are you already had Node.js installed using your Linux package manager, or using another node version manager, or using say Homebrew. The two main ways you might resolve this are:
+
+- uninstall from the old directory and reinstall to the new directory
+- put the `bin` directory that `n` uses early in the `PATH` environment variable, so the `n` installed node is found first
+
+The simplest setup to understand is the first one. Just have one version of `node` installed.
+
+Let's walk-through the process of switching over from using Homebrew as an example. Let's start off with Node.js installed, `npm` updated, and an example global npm package. The key point is there are two install prefixes involved:
+
+- old: `/opt/homebrew`
+- new: `/usr/local`
+
+```console
+% brew install node
+% npm install --global npm@latest
+% npm install --global @shadowspawn/forest-arborist
+% brew list node
+/opt/homebrew/Cellar/node/21.7.3/bin/node
+/opt/homebrew/Cellar/node/21.7.3/bin/npm
+/opt/homebrew/Cellar/node/21.7.3/bin/npx
+/opt/homebrew/Cellar/node/21.7.3/etc/bash_completion.d/npm
+/opt/homebrew/Cellar/node/21.7.3/include/node/ (107 files)
+/opt/homebrew/Cellar/node/21.7.3/libexec/bin/ (2 files)
+/opt/homebrew/Cellar/node/21.7.3/libexec/lib/ (2012 files)
+/opt/homebrew/Cellar/node/21.7.3/share/doc/ (2 files)
+/opt/homebrew/Cellar/node/21.7.3/share/man/man1/node.1
+% command -v node
+/opt/homebrew/bin/node
+% command -v npm
+/opt/homebrew/bin/npm
+% npm prefix --global
+/opt/homebrew
+```
+
+Before we start transferring, list the global npm packages in the "old" location. We will refer back to this list.
+
+```console
+% npm list --global
+/opt/homebrew/lib
+├── @shadowspawn/forest-arborist@12.0.0
+└── npm@10.5.0
+```
+
+We could clean out the old location first, but let's install `n` and another copy of node and see what that looks like. We end up with two versions of node, and the active one is still the Homebrew managed version.
+
+```console
+% brew install n
+% n lts
+ installing : node-v20.12.2
+ mkdir : /usr/local/n/versions/node/20.12.2
+ fetch : https://nodejs.org/dist/v20.12.2/node-v20.12.2-darwin-arm64.tar.xz
+ copying : node/20.12.2
+ installed : v20.12.2 to /usr/local/bin/node
+ active : v21.7.3 at /opt/homebrew/bin/node
+% command -v node
+/opt/homebrew/bin/node
+% which -a node
+/opt/homebrew/bin/node
+/usr/local/bin/node
+% command -v npm
+/opt/homebrew/bin/npm
+% command -v npx
+/opt/homebrew/bin/npx
+% n doctor
+<...>
+
+CHECKS
+
+Checking n install destination is in PATH...
+good
+
+Checking n install destination priority in PATH...
+⚠️ There is a version of node installed which will be found in PATH before the n installed version.
+
+Checking npm install destination...
+⚠️ There is an active version of npm shadowing the version installed by n. Check order of entries in PATH.
+ installed : /usr/local/bin/npm
+ active : /opt/homebrew/bin/npm
+
+<...>
+```
+
+Now let's switch over. Delete everything from the old location. Delete all the global npm packages _except_ npm itself, then delete npm, then delete node.
+
+```console
+npm uninstall --global @shadowspawn/forest-arborist
+
+npm uninstall --global npm
+
+brew uninstall node
+```
+
+Check the active binaries are now the ones installed by `n`:
+```console
+% command -v node
+/usr/local/bin/node
+% command -v npm
+/usr/local/bin/npm
+% command -v npx
+/usr/local/bin/npx
+```
+
+And lastly, reinstall the global npm packages you started with:
+```
+% npm prefix --global
+/usr/local
+% npm install --global npm@latest
+% npm install --global @shadowspawn/forest-arborist
+% npm list -g
+/usr/local/lib
+├── @shadowspawn/forest-arborist@12.0.0
+└── npm@10.5.0
+```
------------------------------------------------------------
commit 371affba8a21ec95ca1cab784ef409c879e6ce83
Author: John Gee <john@ruru.gen.nz>
Date: Sun Apr 21 12:34:04 2024 +1200
9.2.3
diff --git a/package-lock.json b/package-lock.json
index 836f489..3bfe6ad 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "n",
- "version": "9.2.3-0",
+ "version": "9.2.3",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/package.json b/package.json
index 5621262..8bd787c 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "n",
"description": "Interactively Manage All Your Node Versions",
- "version": "9.2.3-0",
+ "version": "9.2.3",
"author": "TJ Holowaychuk <tj@vision-media.ca>",
"homepage": "https://github.com/tj/n",
"bugs": "https://github.com/tj/n/issues",
------------------------------------------------------------
commit 010f060b7bf3d386441fdcb4e6a01167134d57d4
Author: John Gee <john@ruru.gen.nz>
Date: Sun Apr 21 12:33:23 2024 +1200
Prepare for release
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 355e460..f9f8466 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,12 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
<!-- markdownlint-disable MD024 -->
-## [9.2.2] (2024-04-21)
+## [9.2.3] (2024-04-21)
### Fixed
- avoid problems with `curl` 8.7.1 and `--compressed` by removing option until fixed
+## [9.2.2] (2024-04-21)
+
+(No changes.)
+
## [9.2.1] (2024-02-25)
### Fixed
@@ -504,6 +508,7 @@ Only minor functional changes, but technically could break scripts relying on sp
<!-- reference links for releases -->
[Unreleased]: https://github.com/tj/n/compare/master...develop
+[9.2.3]: https://github.com/tj/n/compare/v9.2.2...v9.2.3
[9.2.2]: https://github.com/tj/n/compare/v9.2.1...v9.2.2
[9.2.1]: https://github.com/tj/n/compare/v9.2.0...v9.2.1
[9.2.0]: https://github.com/tj/n/compare/v9.1.0...v9.2.0
diff --git a/bin/n b/bin/n
index f43a549..86b6a0f 100755
--- a/bin/n
+++ b/bin/n
@@ -61,7 +61,7 @@ function n_grep() {
# Setup and state
#
-VERSION="v9.2.3-0"
+VERSION="v9.2.3"
N_PREFIX="${N_PREFIX-/usr/local}"
N_PREFIX=${N_PREFIX%/}
------------------------------------------------------------
commit 8974241cbeb8bdcf5d3fb1c6ccc44c4b4cf55e6f
Merge: 723bfcd f9ee486
Author: John Gee <john@ruru.gen.nz>
Date: Sun Apr 21 12:30:05 2024 +1200
Merge branch 'develop' of github.com:tj/n into develop
------------------------------------------------------------
commit f9ee486b784761f8e77e6f48f26227bc1c0e6f6a
Author: John Gee <john@ruru.gen.nz>
Date: Sun Apr 21 12:29:18 2024 +1200
Remove use of curl --compressed due to a bug in 8.7.1 (#801)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index aa8b7a2..355e460 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,7 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
<!-- markdownlint-disable MD024 -->
-## [Unreleased] (date goes here)
+## [9.2.2] (2024-04-21)
+
+### Fixed
+
+- avoid problems with `curl` 8.7.1 and `--compressed` by removing option until fixed
## [9.2.1] (2024-02-25)
@@ -500,6 +504,7 @@ Only minor functional changes, but technically could break scripts relying on sp
<!-- reference links for releases -->
[Unreleased]: https://github.com/tj/n/compare/master...develop
+[9.2.2]: https://github.com/tj/n/compare/v9.2.1...v9.2.2
[9.2.1]: https://github.com/tj/n/compare/v9.2.0...v9.2.1
[9.2.0]: https://github.com/tj/n/compare/v9.1.0...v9.2.0
[9.1.0]: https://github.com/tj/n/compare/v9.0.1...v9.1.0
diff --git a/bin/n b/bin/n
index a9bfc9f..3e5e216 100755
--- a/bin/n
+++ b/bin/n
@@ -61,7 +61,7 @@ function n_grep() {
# Setup and state
#
-VERSION="v9.2.2-0"
+VERSION="v9.2.2"
N_PREFIX="${N_PREFIX-/usr/local}"
N_PREFIX=${N_PREFIX%/}
@@ -853,7 +853,7 @@ function do_get() {
function do_get_index() {
if command -v curl &> /dev/null; then
# --silent to suppress progress et al
- curl --silent --compressed "${CURL_OPTIONS[@]}" "$@"
+ curl --silent "${CURL_OPTIONS[@]}" "$@"
elif command -v wget &> /dev/null; then
wget "${WGET_OPTIONS[@]}" "$@"
else
------------------------------------------------------------
commit 723bfcded118c73cfb3c67407bb3da6129c95faf
Author: John Gee <john@ruru.gen.nz>
Date: Sun Apr 21 12:28:50 2024 +1200
Post-release
diff --git a/bin/n b/bin/n
index a9bfc9f..a402fae 100755
--- a/bin/n
+++ b/bin/n
@@ -61,7 +61,7 @@ function n_grep() {
# Setup and state
#
-VERSION="v9.2.2-0"
+VERSION="v9.2.3-0"
N_PREFIX="${N_PREFIX-/usr/local}"
N_PREFIX=${N_PREFIX%/}
diff --git a/package-lock.json b/package-lock.json
index 28f7c3b..836f489 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "n",
- "version": "9.2.2",
+ "version": "9.2.3-0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/package.json b/package.json
index 952c0f4..5621262 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "n",
"description": "Interactively Manage All Your Node Versions",
- "version": "9.2.2",
+ "version": "9.2.3-0",
"author": "TJ Holowaychuk <tj@vision-media.ca>",
"homepage": "https://github.com/tj/n",
"bugs": "https://github.com/tj/n/issues",
------------------------------------------------------------
commit 059b39d5f8aa4c8c0f6fa4796d6b961f927e247d
Author: John Gee <john@ruru.gen.nz>
Date: Sun Apr 21 12:24:25 2024 +1200
9.2.2
diff --git a/package-lock.json b/package-lock.json
index 2c9e540..28f7c3b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "n",
- "version": "9.2.2-0",
+ "version": "9.2.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/package.json b/package.json
index b979319..952c0f4 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "n",
"description": "Interactively Manage All Your Node Versions",
- "version": "9.2.2-0",
+ "version": "9.2.2",
"author": "TJ Holowaychuk <tj@vision-media.ca>",
"homepage": "https://github.com/tj/n",
"bugs": "https://github.com/tj/n/issues",
------------------------------------------------------------
commit d1ae8080671cd0e20dcfeb5a88e9d4e1ec21e567
Author: John Gee <john@ruru.gen.nz>
Date: Sun Feb 25 16:38:12 2024 +1300
Post-release
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 19c6e3e..aa8b7a2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
<!-- markdownlint-disable MD024 -->
+## [Unreleased] (date goes here)
+
## [9.2.1] (2024-02-25)
### Fixed
diff --git a/bin/n b/bin/n
index 7628972..a9bfc9f 100755
--- a/bin/n
+++ b/bin/n
@@ -61,7 +61,7 @@ function n_grep() {
# Setup and state
#
-VERSION="v9.2.1"
+VERSION="v9.2.2-0"
N_PREFIX="${N_PREFIX-/usr/local}"
N_PREFIX=${N_PREFIX%/}
diff --git a/package-lock.json b/package-lock.json
index e2bf1bf..2c9e540 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "n",
- "version": "9.2.1",
+ "version": "9.2.2-0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/package.json b/package.json
index 019307a..b979319 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "n",
"description": "Interactively Manage All Your Node Versions",
- "version": "9.2.1",
+ "version": "9.2.2-0",
"author": "TJ Holowaychuk <tj@vision-media.ca>",
"homepage": "https://github.com/tj/n",
"bugs": "https://github.com/tj/n/issues",
------------------------------------------------------------
commit 0ce85771fdff8f4b3e09ade700461b4f58a64444
Author: John Gee <john@ruru.gen.nz>
Date: Sun Feb 25 16:36:38 2024 +1300
9.2.1
diff --git a/package-lock.json b/package-lock.json
index 18a1dc4..e2bf1bf 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "n",
- "version": "9.2.0",
+ "version": "9.2.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/package.json b/package.json
index fcfd41a..019307a 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "n",
"description": "Interactively Manage All Your Node Versions",
- "version": "9.2.0",
+ "version": "9.2.1",
"author": "TJ Holowaychuk <tj@vision-media.ca>",
"homepage": "https://github.com/tj/n",
"bugs": "https://github.com/tj/n/issues",