Changes to n

Helber Belmiro
Helber Belmiro
7 months ago
Fixed broken link (#803)
README.md
Changed around line 90: As a result, both `n` itself and all Node.js versions it manages are hosted insi
- 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.
John Gee
John Gee
8 months ago
Docs for switching node directory (#802)
README.md
Changed around line 13: 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)
Changed around line 88: n-install sets both `PREFIX` and `N_PREFIX` to `$HOME/n`, installs `n` to `$HOME
+ ### 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
+ ```
+
docs/changing-node-location.md
Changed around line 1
+ # 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
+ ```
John Gee
John Gee
9 months ago
9.2.3
package-lock.json
Changed around line 1
- "version": "9.2.3-0",
+ "version": "9.2.3",
package.json
Changed around line 1
- "version": "9.2.3-0",
+ "version": "9.2.3",
John Gee
John Gee
9 months ago
Prepare for release
CHANGELOG.md
Changed around line 7: and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- ## [9.2.2] (2024-04-21)
+ ## [9.2.3] (2024-04-21)
- avoid problems with `curl` 8.7.1 and `--compressed` by removing option until fixed
+ ## [9.2.2] (2024-04-21)
+
+ (No changes.)
+
Changed around line 508: Only minor functional changes, but technically could break scripts relying on sp
+ [9.2.3]: https://github.com/tj/n/compare/v9.2.2...v9.2.3
bin/n
Changed around line 61: function n_grep() {
- VERSION="v9.2.3-0"
+ VERSION="v9.2.3"
John Gee
John Gee
9 months ago
Merge branch 'develop' of github.com:tj/n into develop
John Gee
John Gee
9 months ago
Remove use of curl --compressed due to a bug in 8.7.1 (#801)
CHANGELOG.md
Changed around line 7: and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- ## [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
Changed around line 504: Only minor functional changes, but technically could break scripts relying on sp
+ [9.2.2]: https://github.com/tj/n/compare/v9.2.1...v9.2.2
bin/n
Changed around line 61: function n_grep() {
- VERSION="v9.2.2-0"
+ VERSION="v9.2.2"
Changed around line 853: function do_get() {
- curl --silent --compressed "${CURL_OPTIONS[@]}" "$@"
+ curl --silent "${CURL_OPTIONS[@]}" "$@"
John Gee
John Gee
9 months ago
Post-release
bin/n
Changed around line 61: function n_grep() {
- VERSION="v9.2.2-0"
+ VERSION="v9.2.3-0"
package-lock.json
Changed around line 1
- "version": "9.2.2",
+ "version": "9.2.3-0",
package.json
Changed around line 1
- "version": "9.2.2",
+ "version": "9.2.3-0",
John Gee
John Gee
9 months ago
9.2.2
package-lock.json
Changed around line 1
- "version": "9.2.2-0",
+ "version": "9.2.2",
package.json
Changed around line 1
- "version": "9.2.2-0",
+ "version": "9.2.2",
John Gee
John Gee
11 months ago
Post-release
CHANGELOG.md
Changed around line 7: and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
+ ## [Unreleased] (date goes here)
+
bin/n
Changed around line 61: function n_grep() {
- VERSION="v9.2.1"
+ VERSION="v9.2.2-0"
package-lock.json
Changed around line 1
- "version": "9.2.1",
+ "version": "9.2.2-0",
package.json
Changed around line 1
- "version": "9.2.1",
+ "version": "9.2.2-0",
John Gee
John Gee
11 months ago
9.2.1
package-lock.json
Changed around line 1
- "version": "9.2.0",
+ "version": "9.2.1",
package.json
Changed around line 1
- "version": "9.2.0",
+ "version": "9.2.1",
John Gee
John Gee
11 months ago
Prepare for release
CHANGELOG.md
Changed around line 7: and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- ## [Unreleased] (date goes here)
+ ## [9.2.1] (2024-02-25)
+
+ ### Fixed
+
+ - `n doctor` works with custom `N_CACHE_PREFIX`
+
+ ### Added
+
+ - expand tests in `n doctor` for folder existence and permissions
Changed around line 31: and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- ### Fixes
+ ### Fixed
- `Makefile` compatible with more flavours of `make` ([#745])
- quote paths in `Makefile` in case `PREFIX` contains spaces ([#746])
Changed around line 498: Only minor functional changes, but technically could break scripts relying on sp
+ [9.2.1]: https://github.com/tj/n/compare/v9.2.0...v9.2.1
bin/dev/release
Changed around line 18: function confirm {
- readonly N_VERSION="$(n --version)"
+ readonly N_VERSION="$(./bin/n --version)"
bin/n
Changed around line 61: function n_grep() {
- VERSION="v9.2.0"
+ VERSION="v9.2.1"
John Gee
John Gee
11 months ago
Rework doctor checks to support custom cache prefix (#796)
bin/n
Changed around line 1425: uninstall_installed() {
- echo "- define N_PREFIX to a writeable location, or"
+ if [[ "${N_CACHE_PREFIX}" == "${N_PREFIX}" ]]; then
+ echo "- define N_PREFIX to a writeable location, or"
+ else
+ echo "- define N_PREFIX and N_CACHE_PREFIX to writeable locations, or"
+ fi
Changed around line 1560: function show_diagnostics() {
- printf "\nChecking permissions for cache folder...\n"
- # Most likely problem is ownership rather than than permissions as such.
- local cache_root="${N_PREFIX}/n"
- if [[ -e "${N_PREFIX}" && ! -w "${N_PREFIX}" && ! -e "${cache_root}" ]]; then
- echo_red "You do not have write permission to create: ${cache_root}"
- show_permission_suggestions
- echo "- make a folder you own:"
- echo " sudo mkdir -p \"${cache_root}\""
- echo " sudo chown $(whoami) \"${cache_root}\""
- elif [[ -e "${cache_root}" && ! -w "${cache_root}" ]]; then
- echo_red "You do not have write permission to: ${cache_root}"
- show_permission_suggestions
- echo "- change folder ownership to yourself:"
- echo " sudo chown -R $(whoami) \"${cache_root}\""
- elif [[ ! -e "${cache_root}" ]]; then
- echo "Cache folder does not exist: ${cache_root}"
- echo "This is normal if you have not done an install yet, as cache is only created when needed."
- elif [[ -e "${CACHE_DIR}" && ! -w "${CACHE_DIR}" ]]; then
- echo_red "You do not have write permission to: ${CACHE_DIR}"
- show_permission_suggestions
- echo "- change folder ownership to yourself:"
- echo " sudo chown -R $(whoami) \"${CACHE_DIR}\""
- else
+ printf "\nChecking prefix folders...\n"
+ if [[ ! -e "${N_PREFIX}" ]]; then
+ echo "Folder does not exist: ${N_PREFIX}"
+ echo "- This folder will be created when you do an install."
+ fi
+ if [[ "${N_PREFIX}" != "${N_CACHE_PREFIX}" && ! -e "${N_CACHE_PREFIX}" ]]; then
+ echo "Folder does not exist: ${N_CACHE_PREFIX}"
+ echo "- This folder will be created when you do an install."
+ fi
+ if [[ -e "${N_PREFIX}" && -e "${N_CACHE_PREFIX}" ]]; then
+ if [[ -e "${N_CACHE_PREFIX}" ]]; then
+ printf "\nChecking permissions for cache folder...\n"
+ # Using knowledge cache path ends in /n/versions in following check.
+ if [[ ! -e "${CACHE_DIR}" && (( -e "${N_CACHE_PREFIX}/n" && ! -w "${N_CACHE_PREFIX}/n" ) || ( ! -e "${N_CACHE_PREFIX}/n" && ! -w "${N_CACHE_PREFIX}" )) ]]; then
+ echo_red "You do not have write permission to create: ${CACHE_DIR}"
+ show_permission_suggestions
+ echo "- make a folder you own:"
+ echo " sudo mkdir -p \"${CACHE_DIR}\""
+ echo " sudo chown $(whoami) \"${CACHE_DIR}\""
+ elif [[ ! -e "${CACHE_DIR}" ]]; then
+ echo "Cache folder does not exist: ${CACHE_DIR}"
+ echo "- This is normal if you have not done an install yet, as cache is only created when needed."
+ elif [[ ! -w "${CACHE_DIR}" ]]; then
+ echo_red "You do not have write permission to: ${CACHE_DIR}"
+ show_permission_suggestions
+ echo "- change folder ownership to yourself:"
+ echo " sudo chown -R $(whoami) \"${CACHE_DIR}\""
+ else
+ echo "good"
+ fi
+ fi
+
- # Most likely problem is ownership rather than than permissions as such.
Changed around line 1604: function show_diagnostics() {
+ if [[ ! -e "${N_PREFIX}/${subdir}" && ! -w "${N_PREFIX}" ]]; then
+ install_writeable="false"
+ echo_red "You do not have write permission to create: ${N_PREFIX}/${subdir}"
+ break
+ fi
- echo " (cd \"${N_PREFIX}\" && sudo chown -R $(whoami) bin lib include share)"
+ echo " cd \"${N_PREFIX}\""
+ echo " sudo mkdir -p bin lib include share"
+ echo " sudo chown -R $(whoami) bin lib include share"
John Gee
John Gee
11 months ago
Merge branch 'master' into develop
John Gee
John Gee
11 months ago
Add security and funding (#794)
FUNDING.yml
Changed around line 1
+ github: [tj, shadowspawn]
+ tidelift: npm/n
SECURITY.md
Changed around line 1
+ # Security Policy
+
+ ## Supported Versions
+
+ The latest two major versions get security updates.
+
+ Pull Requests for security issues will be considered for older versions.
+
+ ## Reporting a Vulnerability
+
+ To report a security vulnerability, please use the
+ [Tidelift security contact](https://tidelift.com/security).
+ Tidelift will coordinate the fix and disclosure.
John Gee
John Gee
11 months ago
Add sudo tip to proxy docs
docs/proxy-server.md
Changed around line 14: If your proxy requires authentication you can add the [url-encoded](https://urle
+ If you use `sudo` to run `n`, you need to do something extra to make the environment variables available. A simple way is to use `-E` (`--preserve-env`):
+
+ sudo -E n lts
+
John Gee
John Gee
1 year ago
Restore release version for a documentation-only update
bin/n
Changed around line 61: function n_grep() {
- VERSION="v9.2.1"
+ VERSION="v9.2.0"
package-lock.json
Changed around line 1
- "version": "9.2.1",
+ "version": "9.2.0",
package.json
Changed around line 1
- "version": "9.2.1",
+ "version": "9.2.0",
John Gee
John Gee
1 year ago
Restore release version for a documentation-only update
bin/n
Changed around line 61: function n_grep() {
- VERSION="v9.2.1-0"
+ VERSION="v9.2.1"
package-lock.json
Changed around line 1
- "version": "9.2.1-0",
+ "version": "9.2.1",
package.json
Changed around line 1
- "version": "9.2.1-0",
+ "version": "9.2.1",
John Gee
John Gee
1 year ago
Condense make instructions (#792)
README.md
Changed around line 67: Alternatively, you can clone this repo and
- to install `n` to `bin/n` of the directory specified in the environment variable `$PREFIX`, which defaults to `/usr/local` (note that you will likely need to use `sudo`). To install `n` in a custom location (such as `$CUSTOM_LOCATION/bin/n`), run `PREFIX=$CUSTOM_LOCATION make install`.
+ which defaults to `/usr/local/bin/n`. To install `n` in a custom location such as `$CUSTOM_LOCATION/bin/n`, run `PREFIX=$CUSTOM_LOCATION make install`.
John Gee
John Gee
1 year ago
Expand permissions issues coverage (#790)
README.md
Changed around line 37: If you already have Node.js installed, an easy way to install `n` is using `npm`
- The `n` command downloads and installs to `/usr/local` by default, but you may override this location by defining `N_PREFIX`.
+ The default root location used when running `n` is `/usr/local` where a normal user does not have write permission. You may strike the same sort of permission error when using npm to install global modules, like the above command. You have three main options:
+
+ 1) change the ownership of the relevant directories to yourself (see below)
+ 2) tell `n` to use a custom location where you do have write permissions (see `N_PREFIX`)
+ 3) put `sudo` in front of the command to run it as super user
+
- To avoid requiring `sudo` for `n` and `npm` global installs, it is suggested you either install to your home directory using `N_PREFIX`, or take ownership of the system directories:
+ To take ownership of the system directories (option 1):
John Gee
John Gee
1 year ago
Add --offline to README
README.md
Changed around line 215: List downloaded versions in cache:
+ Use `n` to access cached versions (already downloaded) without internet available.
+
+ n --offline 12
+
John Gee
John Gee
1 year ago
Post-release
bin/n
Changed around line 61: function n_grep() {
- VERSION="v9.2.0"
+ VERSION="v9.2.1-0"
package-lock.json
Changed around line 1
- "version": "9.2.0",
+ "version": "9.2.1-0",
package.json
Changed around line 1
- "version": "9.2.0",
+ "version": "9.2.1-0",
John Gee
John Gee
1 year ago
9.2.0
package-lock.json
Changed around line 1
- "version": "9.1.1-0",
+ "version": "9.2.0",
package.json
Changed around line 1
- "version": "9.1.1-0",
+ "version": "9.2.0",
John Gee
John Gee
1 year ago
Prepare for release
CHANGELOG.md
Changed around line 9: and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
+ ## [9.2.0] (2023-10-15)
+
+ ### Added
+
+ - `--offline` for resolving target version against cached downloads instead of internet lookup ([#785])
+
Changed around line 485: Only minor functional changes, but technically could break scripts relying on sp
+ [#785]: https://github.com/tj/n/pull/785
+ [9.2.0]: https://github.com/tj/n/compare/v9.1.0...v9.2.0
bin/n
Changed around line 61: function n_grep() {
- VERSION="v9.1.1-0"
+ VERSION="v9.2.0"
John Gee
John Gee
1 year ago
Add --offline (#785)
bin/n
Changed around line 135: g_target_node=
+ OFFLINE=false
Changed around line 394: Options:
- q, --quiet Disable curl output. Disable log messages processing "auto" and "engine" labels.
- d, --download Download if necessary, and don't make active
- a, --arch Override system architecture
+ --offline Resolve target version against cached downloads instead of internet lookup
- -all ls-remote displays all matches instead of last 20
- -insecure Turn off certificate checking for https requests (may be needed from behind a proxy server)
- -use-xz/--no-use-xz Override automatic detection of xz support and enable/disable use of xz compressed node downloads.
Changed around line 786: install() {
+ if [[ "$OFFLINE" == "true" ]]; then
+ abort "version unavailable offline"
+ fi
Changed around line 1108: function get_package_engine_version() {
+ [[ "$OFFLINE" != "true" ]] || abort "offline: an internet connection is required for looking up complex 'engine' ranges from package.json"
Changed around line 1205: function get_latest_resolved_version() {
+ elif [[ "$OFFLINE" == "true" ]]; then
+ g_target_node=$(display_local_versions "${version}")
Changed around line 1240: function display_match_limit(){
+ #
+ # Synopsis: display_local_versions version
+ #
+
+ function display_local_versions() {
+ local version="$1"
+ local match='.'
+ verbose_log "offline" "matching cached versions"
+
+ # Transform some labels before processing further.
+ if is_node_support_version "${version}"; then
+ version="$(display_latest_node_support_alias "${version}")"
+ match_count=1
+ elif [[ "${version}" = "auto" ]]; then
+ # suppress stdout logging so lsr layout same as usual for scripting
+ get_auto_version || return 2
+ version="${g_target_node}"
+ elif [[ "${version}" = "engine" ]]; then
+ # suppress stdout logging so lsr layout same as usual for scripting
+ get_engine_version || return 2
+ version="${g_target_node}"
+ fi
+
+ if [[ "${version}" = "latest" || "${version}" = "current" ]]; then
+ match='^node/.'
+ elif is_exact_numeric_version "${version}"; then
+ # Quote any dots in version so they are literal for expression
+ match="^node/${version//\./\.}"
+ elif is_numeric_version "${version}"; then
+ version="${version#v}"
+ # Quote any dots in version so they are literal for expression
+ match="${version//\./\.}"
+ # Avoid 1.2 matching 1.23
+ match="^node/${match}[^0-9]"
+ # elif is_lts_codename "${version}"; then
+ # see if demand
+ elif is_download_folder "${version}"; then
+ match="^${version}/"
+ # elif is_download_version "${version}"; then
+ # see if demand
+ else
+ abort "invalid version '$1' for offline matching"
+ fi
+
+ display_versions_paths \
+ | n_grep -E "${match}" \
+ | tail -n 1 \
+ | sed 's|node/||'
+ }
+
Changed around line 1635: while [[ $# -ne 0 ]]; do
- h|--help|help) display_help; exit ;;
- q|--quiet) set_quiet ;;
- d|--download) DOWNLOAD="true" ;;
+ --offline) OFFLINE="true" ;;
- -insecure) set_insecure ;;
- p|--preserve) N_PRESERVE_NPM="true" N_PRESERVE_COREPACK="true" ;;
- -no-preserve) N_PRESERVE_NPM="" N_PRESERVE_COREPACK="" ;;
test/tests/offline.bats
Changed around line 1
+ #!/usr/bin/env bats
+
+ load shared-functions
+ load '../../node_modules/bats-support/load'
+ load '../../node_modules/bats-assert/load'
+
+ function setup_file() {
+ unset_n_env
+ setup_tmp_prefix
+ # Note, NOT latest version of 16.
+ n --download 16.19.0
+ export N_NODE_MIRROR="https://no.internet.available"
+ }
+
+ function teardown_file() {
+ rm -rf "${TMP_PREFIX_DIR}"
+ }
+
+ function setup() {
+ hash -r
+ }
+
+ @test "n --offline 16" {
+ n --offline 16
+ hash -r
+ output="$(node --version)"
+ assert_equal "${output}" "v16.19.0"
+ rm "${TMP_PREFIX_DIR}/bin/node"
+ }
+
+ @test "n --offline latest" {
+ n --offline latest
+ hash -r
+ output="$(node --version)"
+ assert_equal "${output}" "v16.19.0"
+ rm "${TMP_PREFIX_DIR}/bin/node"
+ }
+
+ @test "n --offline run 16..." {
+ output="$(n --offline run 16 --version)"
+ assert_equal "${output}" "v16.19.0"
+ }
+
+ @test "n --offline exec 16..." {
+ output="$(n --offline exec 16 node --version)"
+ assert_equal "${output}" "v16.19.0"
+ }
+
+ @test "n --offline which 16..." {
+ output="$(n --offline which 16)"
+ assert_equal "${output}" "${TMP_PREFIX_DIR}/n/versions/node/16.19.0/bin/node"
+ }
Mark Dorison
Mark Dorison
1 year ago
Update path to Homebrew formula. (#777)
README.md
Changed around line 66: to install `n` to `bin/n` of the directory specified in the environment variable
- On macOS with [Homebrew](https://brew.sh/) you can install the [n formula](https://github.com/Homebrew/homebrew-core/blob/master/Formula/n.rb).
+ On macOS with [Homebrew](https://brew.sh/) you can install the [n formula](https://github.com/Homebrew/homebrew-core/blob/master/Formula/n/n.rb).
John Gee
John Gee
1 year ago
Post release
bin/n
Changed around line 61: function n_grep() {
- VERSION="v9.1.0"
+ VERSION="v9.1.1-0"
package-lock.json
Changed around line 1
- "version": "9.1.0",
+ "version": "9.1.1-0",
package.json
Changed around line 1
- "version": "9.1.0",
+ "version": "9.1.1-0",
John Gee
John Gee
1 year ago
9.1.0
package-lock.json
Changed around line 1
- "version": "9.0.2-0",
+ "version": "9.1.0",
package.json
Changed around line 1
- "version": "9.0.2-0",
+ "version": "9.1.0",
John Gee
John Gee
1 year ago
Update CHANGELOG and version for v9.1.0
CHANGELOG.md
Changed around line 9: and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
+ ## [9.1.0] (2023-04-15)
+
+ ### Added
+
+ - check for possible problem with multiple `npm` locations when running `n doctor` ([#764])
+
Changed around line 478: Only minor functional changes, but technically could break scripts relying on sp
+ [#764]: https://github.com/tj/n/pull/764
+ [9.1.0]: https://github.com/tj/n/compare/v9.0.1...v9.1.0
bin/n
Changed around line 61: function n_grep() {
- VERSION="v9.0.2-0"
+ VERSION="v9.1.0"
John Gee
John Gee
1 year ago
Add npm check to doctor (#764)
bin/n
Changed around line 1484: function show_diagnostics() {
+ # Check npm too. Simpler check than for PATH and node, more like the runtime logging for active/installed node.
+ if [[ -z "${N_PRESERVE_NPM}" ]]; then
+ printf "\nChecking npm install destination...\n"
+ local installed_npm="${N_PREFIX}/bin/npm"
+ local active_npm="$(command -v npm)"
+ if [[ -e "${active_npm}" && -e "${installed_npm}" && "${active_npm}" != "${installed_npm}" ]]; then
+ echo_red "There is an active version of npm shadowing the version installed by n. Check order of entries in PATH."
+ log "installed" "${installed_npm}"
+ log "active" "${active_npm}"
+ else
+ printf "good\n"
+ fi
+ fi
+
John Gee
John Gee
1 year ago
Add fedora as a second Linux for main tests (#756)
test/bin/run-all-tests
Changed around line 2
- services=( ubuntu-curl ubuntu-wget )
+ services=( fedora-curl ubuntu-wget )
test/docker-compose.yml
Changed around line 14: services:
+ fedora-curl:
+ extends:
+ file: ./docker-base.yml
+ service: testbed
+ build:
+ context: dockerfiles
+ dockerfile: Dockerfile-fedora-curl
test/dockerfiles/Dockerfile-fedora-curl
Changed around line 1
+ FROM fedora:latest
+
+ CMD ["/bin/bash"]
John Gee
John Gee
1 year ago
Update tests after old files missing (#757)
test/tests/lsr.bats
Changed around line 112: function setup() {
- @test "n=1 n lsr nightly/v10.8.1-nightly201808 # partial match" {
- output="$(N_MAX_REMOTE_MATCHES=1 n lsr nightly/v10.8.1-nightly201808)"
- assert_equal "${output}" "10.8.1-nightly2018081382830a809b"
+ @test "n=1 n lsr nightly/v12.0.0-nightly2019040 # partial match" {
+ output="$(N_MAX_REMOTE_MATCHES=1 n lsr nightly/v12.0.0-nightly2019040)"
+ assert_equal "${output}" "12.0.0-nightly2019040166b95362df"
- @test "n=1 n lsr nightly/7.1 # numeric match" {
- output="$(N_MAX_REMOTE_MATCHES=1 n lsr nightly/7.1)"
- assert_equal "${output}" "7.1.1-nightly201611093daf11635d"
+ @test "n=1 n lsr nightly/12.0 # numeric match" {
+ output="$(N_MAX_REMOTE_MATCHES=1 n lsr nightly/12.0)"
+ assert_equal "${output}" "12.0.0-nightly2019040166b95362df"
- @test "n=1 n lsr nightly/v7.1 # numeric match" {
- output="$(N_MAX_REMOTE_MATCHES=1 n lsr nightly/v7.1)"
- assert_equal "${output}" "7.1.1-nightly201611093daf11635d"
+ @test "n=1 n lsr nightly/v12.0 # numeric match" {
+ output="$(N_MAX_REMOTE_MATCHES=1 n lsr nightly/v12.0)"
+ assert_equal "${output}" "12.0.0-nightly2019040166b95362df"
- @test "n lsr nightly/v6.10.3-nightly2017040479546c0b5a # exact" {
- output="$(N_MAX_REMOTE_MATCHES=1 n lsr nightly/v6.10.3-nightly2017040479546c0b5a)"
- assert_equal "${output}" "6.10.3-nightly2017040479546c0b5a"
+ @test "n lsr nightly/v12.0.0-nightly2019040166b95362df # exact" {
+ output="$(N_MAX_REMOTE_MATCHES=1 n lsr nightly/v12.0.0-nightly2019040166b95362df)"
+ assert_equal "${output}" "12.0.0-nightly2019040166b95362df"
John Gee
John Gee
2 years ago
Merge remote-tracking branch 'origin/master' into develop
John Gee
John Gee
2 years ago
Rework bootstrap steps to avoid temporary file
README.md
Changed around line 52: To avoid requiring `sudo` for `n` and `npm` global installs, it is suggested you
- If `npm` is not yet available, one way to bootstrap an install:
+ If `npm` is not yet available, one way to bootstrap an install is to download and run `n` directly. To install the `lts` version of Node.js:
- curl -L https://raw.githubusercontent.com/tj/n/master/bin/n -o n
- bash n lts
- # Now node and npm are available
+ curl -fsSL https://raw.githubusercontent.com/tj/n/master/bin/n | bash -s lts
+ # If you want n installed, you can use npm now.
John Gee
John Gee
2 years ago
Rework bootstrap steps to avoid temporary file (#754)
README.md
Changed around line 52: To avoid requiring `sudo` for `n` and `npm` global installs, it is suggested you
- If `npm` is not yet available, one way to bootstrap an install:
+ If `npm` is not yet available, one way to bootstrap an install is to download and run `n` directly. To install the `lts` version of Node.js:
- curl -L https://raw.githubusercontent.com/tj/n/master/bin/n -o n
- bash n lts
- # Now node and npm are available
+ curl -fsSL https://raw.githubusercontent.com/tj/n/master/bin/n | bash -s lts
+ # If you want n installed, you can use npm now.
John Gee
John Gee
2 years ago
Remove tests support for running over proxy and remove ArchLinux from tests (#750)
bin/dev/release
test/bin/proxy-build
Changed around line 0
- #!/usr/bin/env bash
- # Unoffical bash safe mode
- set -euo pipefail
- BIN_DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
-
- waitproxy() {
- while ! nc -z localhost 8080 ; do sleep 1 ; done
- }
-
- if nc -z localhost 8080; then
- echo "Error: port 8080 already in use. Is mitmdump already running?"
- pgrep -f -l mitmdump
- exit 2
- fi
-
- echo "Launching proxy..."
- mitmdump -w proxy~~.dump &> /dev/null &
- mitm_process="$!"
- echo "Waiting for proxy..."
- waitproxy
-
- echo "Recording downloads..."
-
- source tests/shared-functions.bash
- unset_n_env
- setup_tmp_prefix
-
- # Hack curl to avoid certificate issues with proxy
- readonly CURL_HOME="$(dirname "${BIN_DIRECTORY}")/config"
- export CURL_HOME
-
- # Go through proxy so it can record traffic, http for taobao redirects
- http_proxy="$(hostname):8080"
- export http_proxy
- https_proxy="$(hostname):8080"
- export https_proxy
-
- # Need to do wget first, as curl gets compressed index.tab which will break wget.
- # linux, archlinux-curl gets gz archives
- docker-compose run archlinux-curl /mnt/test/tests/install-reference-versions.bash
- # linux, ubuntu-curl would get compressed index and gz archives
- docker-compose run ubuntu-wget /mnt/test/tests/install-reference-versions.bash
- # native
- tests/install-reference-versions.bash
-
- rm -rf "${TMP_PREFIX_DIR}"
- echo "Stopping proxy"
- kill "${mitm_process}"
-
test/bin/proxy-run
Changed around line 0
- #!/usr/bin/env bash
- BIN_DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
-
- echo ""
- echo "To make use of proxy server:"
- echo " export https_proxy=\"$(hostname):8080\""
- echo " export http_proxy=\"$(hostname):8080\""
- echo " export CURL_HOME=$(dirname "${BIN_DIRECTORY}")/config"
- echo ""
-
- echo "Launching proxy server..."
- mitmdump --server-replay-nopop --server-replay proxy~~.dump
test/bin/run-all-tests
Changed around line 2
- services=( archlinux-curl ubuntu-wget )
+ services=( ubuntu-curl ubuntu-wget )
test/config/.curlrc
Changed around line 0
- # Allow use of mitm proxy
test/config/.wgetrc
Changed around line 0
- # Allow use of mitm proxy
- check_certificate = off
test/docker-base.yml
Changed around line 16: services:
- ../node_modules/bats-assert:/mnt/node_modules/bats-assert
- ../bin/n:/usr/local/bin/n
- # override settings to allow insecure connection in case using mitm proxy
- - ./config/.curlrc:/root/.curlrc
- - ./config/.wgetrc:/root/.wgetrc
- environment:
- # pass through proxy settings to allow caching proxy
- - http_proxy
- - https_proxy
test/docker-compose.yml
Changed around line 14: services:
- archlinux-curl:
- extends:
- file: ./docker-base.yml
- service: testbed
- build:
- context: dockerfiles
- dockerfile: Dockerfile-archlinux-curl
test/dockerfiles/Dockerfile-archlinux-curl
Changed around line 0
- FROM archlinux:latest
-
- CMD ["/bin/bash"]
test/tests.md
Changed around line 28: Run single test on a single system::
- ## Proxy
-
- To speed up running tests multiple times, you can optionally run a caching proxy for the node downloads. The curl settings are modified
- to allow an insecure connection through the mitm proxy.
-
- cd test
- bin/proxy-build
- bin/proxy-run
- # follow the instructions for configuring environment variables for using proxy, then run tests
-
- `node` versions added to proxy cache (and used in tests):
-
- * v4.9.1
- * lts
- * latest
-
test/tests/install-reference-versions.bash
Changed around line 0
- #!/usr/bin/env bash
-
- # These are the versions installed and hence cached by proxy-build.
-
- # Run commands we want to cache downloads for.
-
- # Get index into cache for lookups of expected versions. Uncompressed.
- curl --location --fail https://nodejs.org/dist/index.tab &> /dev/null
- curl --location --fail https://nodejs.org/download/nightly/index.tab &> /dev/null
-
- # Using 4.9.1 as a well known old version (which is no longer getting updated so does not change)
- n --download 4
- n --download lts
- n --download latest
- n --download nightly/latest
- N_NODE_MIRROR=https://npmmirror.com/mirrors/node n --download 6.11
John Gee
John Gee
2 years ago
Bump version post-release
bin/n
Changed around line 61: function n_grep() {
- VERSION="v9.0.1"
+ VERSION="v9.0.2-0"
package-lock.json
Changed around line 1
- "version": "9.0.1",
+ "version": "9.0.2-0",
package.json
Changed around line 1
- "version": "9.0.1",
+ "version": "9.0.2-0",
John Gee
John Gee
2 years ago
9.0.1
package-lock.json
Changed around line 1
- "version": "9.0.1-0",
+ "version": "9.0.1",
package.json
Changed around line 1
- "version": "9.0.1-0",
+ "version": "9.0.1",
John Gee
John Gee
2 years ago
Prepare for release
CHANGELOG.md
Changed around line 9: and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
+ ## [9.0.1] (2022-11-04)
+
+ ### Fixes
+
+ - `Makefile` compatible with more flavours of `make` ([#745])
+ - quote paths in `Makefile` in case `PREFIX` contains spaces ([#746])
+
Changed around line 470: Only minor functional changes, but technically could break scripts relying on sp
+ [#745]: https://github.com/tj/n/pull/745
+ [#746]: https://github.com/tj/n/pull/746
+ [9.0.1]: https://github.com/tj/n/compare/v9.0.0...v9.0.1
bin/n
Changed around line 61: function n_grep() {
- VERSION="v9.0.1-0"
+ VERSION="v9.0.1"
John Gee
John Gee
2 years ago
Add quotes to work with PREFIX containing spaces (#746)
Makefile
Changed around line 1
- mkdir -p $(PREFIX)/bin
- cp bin/n $(PREFIX)/bin/n
+ mkdir -p "$(PREFIX)/bin"
+ cp bin/n "$(PREFIX)/bin/n"
- rm -f $(PREFIX)/bin/n
+ rm -f "$(PREFIX)/bin/n"
Kaíque Kandy Koga
Kaíque Kandy Koga
2 years ago
$< make (#745) * Apparently $< is not working propertly on FreeBSD. Changing the Makefile from $< to bin/n works. * Simplify mkdir
Makefile
Changed around line 1
- mkdir -p $(PREFIX)/$(dir $<)
- cp $< $(PREFIX)/$<
+ mkdir -p $(PREFIX)/bin
+ cp bin/n $(PREFIX)/bin/n
John Gee
John Gee
2 years ago
Add codename Jod
bin/n
Changed around line 256: function update_arch_settings_for_version() {
- [[ "$1" =~ ^([Aa]rgon|[Bb]oron|[Cc]arbon|[Dd]ubnium|[Ee]rbium|[Ff]ermium|[Gg]allium|[Hh]ydrogen|[Ii]ron)$ ]]
+ [[ "$1" =~ ^([Aa]rgon|[Bb]oron|[Cc]arbon|[Dd]ubnium|[Ee]rbium|[Ff]ermium|[Gg]allium|[Hh]ydrogen|[Ii]ron|[Jj]od)$ ]]
John Gee
John Gee
2 years ago
Merge branch 'master' into develop
John Gee
John Gee
2 years ago
Merge branch 'master' of github.com:tj/n
John Gee
John Gee
2 years ago
Post release
CHANGELOG.md
Changed around line 7: and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
+ ## [Unreleased] (date goes here)
+
bin/n
Changed around line 61: function n_grep() {
- VERSION="v9.0.0"
+ VERSION="v9.0.1-0"
package-lock.json
Changed around line 1
- "version": "9.0.0",
+ "version": "9.0.1-0",
package.json
Changed around line 1
- "version": "9.0.0",
+ "version": "9.0.1-0",
John Gee
John Gee
2 years ago
9.0.0
package-lock.json
Changed around line 1
- "version": "8.2.1-0",
+ "version": "9.0.0",
package.json
Changed around line 1
- "version": "8.2.1-0",
+ "version": "9.0.0",
John Gee
John Gee
2 years ago
Prepare for release
CHANGELOG.md
Changed around line 7: and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- ## [Unreleased] (date goes here)
+ ## [9.0.0] (2022-07-16)
+
+ ### Changed
+
+ - `--preserve` preserves `corepack` too ([#736])
+
+ ### Added
+
+ - optional `N_PRESERVE_COREPACK` to change default behaviour for preserving `corepack` ([#736])
Changed around line 460: Only minor functional changes, but technically could break scripts relying on sp
+ [#736]: https://github.com/tj/n/pull/736
+ [9.0.0]: https://github.com/tj/n/compare/v8.2.0...v9.0.0
bin/n
Changed around line 61: function n_grep() {
- VERSION="v8.2.1-0"
+ VERSION="v9.0.0"
John Gee
John Gee
2 years ago
Adjust tests with updated servers and npx behaviour
test/tests/install-reference-versions.bash
Changed around line 13: n --download 4
- N_NODE_MIRROR=https://npm.taobao.org/mirrors/node n --download 6.11
+ N_NODE_MIRROR=https://npmmirror.com/mirrors/node n --download 6.11
test/tests/version-resolve-auto-engine.bats
Changed around line 162: function write_engine() {
- output="$(n N_TEST_DISPLAY_LATEST_RESOLVED_VERSION auto)"
+ # newer versions of npx not liking proxy as used in tests
+ output="$(https_proxy= n N_TEST_DISPLAY_LATEST_RESOLVED_VERSION auto)"
- output="$(n N_TEST_DISPLAY_LATEST_RESOLVED_VERSION auto)"
+ # newer versions of npx not liking proxy as used in tests
+ output="$(https_proxy= n N_TEST_DISPLAY_LATEST_RESOLVED_VERSION auto)"
- output="$(n N_TEST_DISPLAY_LATEST_RESOLVED_VERSION auto)"
+ # newer versions of npx not liking proxy as used in tests
+ output="$(https_proxy= n N_TEST_DISPLAY_LATEST_RESOLVED_VERSION auto)"
John Gee
John Gee
2 years ago
Add N_PRESERVE_COREPACK (#736)
README.md
Changed around line 179: Or execute a command with `PATH` modified so `node` and `npm` will be from the d
- A Node.js install normally includes `npm` as well, but you may wish to preserve an updated `npm` and `npx` leaving them out of the install using `--preserve`:
+ A Node.js install normally also includes `npm`, `npx`, and `corepack`, but you may wish to preserve your current (especially newer) versions using `--preserve`:
+ # Node.js 8.17.0 includes (older) npm 6.13.4
- You can make this the default by setting `N_PRESERVE_NPM` to a non-empty string.
+ You can make this the default by setting the environment variable to a non-empty string. There are separate environment variables for `npm` and `corepack`:
+ export N_PRESERVE_COREPACK=1
- You can be explicit to get the desired behaviour whatever the environment variable:
+ You can be explicit to get the desired behaviour whatever the environment variables:
Changed around line 278: In brief:
- support for [NO_COLOR](https://no-color.org) and [CLICOLOR=0](https://bixense.com/clicolors) for controlling use of ANSI color codes
- `N_MAX_REMOTE_MATCHES` to change the default `ls-remote` maximum of 20 matching versions
- `N_PRESERVE_NPM`: See [Preserving npm](#preserving-npm)
+ - `N_PRESERVE_COREPACK`: See [Preserving npm](#preserving-npm)
bin/n
Changed around line 695: activate() {
- if [[ -e "$dir/lib/node_modules/corepack" ]]; then
+ if [[ -e "$dir/lib/node_modules/corepack" && -z "${N_PRESERVE_COREPACK}" ]]; then
Changed around line 707: activate() {
- [[ -e "$dir/bin/corepack" ]] && cp -fR "$dir/bin/corepack" "$N_PREFIX/bin" # from 16.9.0
+ if [[ -z "${N_PRESERVE_COREPACK}" ]]; then
+ [[ -e "$dir/bin/corepack" ]] && cp -fR "$dir/bin/corepack" "$N_PREFIX/bin" # from 16.9.0
+ fi
Changed around line 1424: function show_diagnostics() {
+ [[ -n "${N_PRESERVE_COREPACK}" ]] && echo "installs preserve corepack by default"
Changed around line 1564: while [[ $# -ne 0 ]]; do
- q|--quiet) set_quiet ;;
- d|--download) DOWNLOAD="true" ;;
- -insecure) set_insecure ;;
- -p|--preserve) N_PRESERVE_NPM="true" ;;
- --no-preserve) N_PRESERVE_NPM="" ;;
+ -p|--preserve) N_PRESERVE_NPM="true" N_PRESERVE_COREPACK="true" ;;
+ --no-preserve) N_PRESERVE_NPM="" N_PRESERVE_COREPACK="" ;;
- -use-xz) N_USE_XZ="true" ;;
- -no-use-xz) N_USE_XZ="false" ;;
- -latest) display_remote_versions latest; exit ;;
test/tests/shared-functions.bash
Changed around line 13: function unset_n_env(){
+ unset N_PRESERVE_COREPACK
Sukka
Sukka
2 years ago
Chore: replace `git.io` in installation guide (#724) https://github.com/mklement0/n-install/commit/d6f6db0b8eaf25b3faa513135675f86b0fdcb4e4
README.md
Changed around line 77: Or on macOS with [MacPorts](https://www.macports.org/) you can install the [n po
- curl -L https://git.io/n-install | bash
+ curl -L https://bit.ly/n-install | bash
John Gee
John Gee
2 years ago
Post release
CHANGELOG.md
Changed around line 7: and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
+ ## [Unreleased] (date goes here)
+
bin/n
Changed around line 61: function n_grep() {
- VERSION="v8.2.0"
+ VERSION="v8.2.1-0"
package-lock.json
Changed around line 1
- "version": "8.2.0",
+ "version": "8.2.1-0",
package.json
Changed around line 1
- "version": "8.2.0",
+ "version": "8.2.1-0",
John Gee
John Gee
2 years ago
8.2.0
package-lock.json
Changed around line 1
- "version": "8.1.1-0",
+ "version": "8.2.0",
package.json
Changed around line 1
- "version": "8.1.1-0",
+ "version": "8.2.0",
John Gee
John Gee
2 years ago
Prepare for release
CHANGELOG.md
Changed around line 7: and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- ## [Unreleased] (date goes here)
+ ## [8.2.0] (2022-04-18)
+
+ ### Added
+
+ - log before copying files during install ([#720])
Changed around line 449: Only minor functional changes, but technically could break scripts relying on sp
+ [#720]: https://github.com/tj/n/issues/720
+ [8.2.0]: https://github.com/tj/n/compare/v8.1.0...v8.2.0
bin/n
Changed around line 61: function n_grep() {
- VERSION="v8.1.1-0"
+ VERSION="v8.2.0"
John Gee
John Gee
2 years ago
Add log before copying during install
bin/n
Changed around line 672: activate() {
+ log "copying" "$version"
+
John Gee
John Gee
2 years ago
Post-release
CHANGELOG.md
Changed around line 7: and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
+ ## [Unreleased] (date goes here)
+
bin/n
Changed around line 61: function n_grep() {
- VERSION="v8.1.0"
+ VERSION="v8.1.1-0"
package-lock.json
Changed around line 1
- "version": "8.1.0",
+ "version": "8.1.1-0",
package.json
Changed around line 1
- "version": "8.1.0",
+ "version": "8.1.1-0",
John Gee
John Gee
2 years ago
8.1.0
package-lock.json
Changed around line 1
- "version": "8.0.3-0",
+ "version": "8.1.0",
package.json
Changed around line 1
- "version": "8.0.3-0",
+ "version": "8.1.0",
John Gee
John Gee
2 years ago
Prepeare for release
CHANGELOG.md
Changed around line 7: and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- ## Unreleased (date goes here)
+ ## [8.1.0] (2022-03-18)
+
+ ### Added
+
+ - optional `N_CACHE_PREFIX` for separate location for downloaded files than install location ([#717])
Changed around line 442: Only minor functional changes, but technically could break scripts relying on sp
+ [#717]: https://github.com/tj/n/issues/717
+ [8.1.0]: https://github.com/tj/n/compare/v8.0.2...v8.1.0
bin/n
Changed around line 61: function n_grep() {
- VERSION="v8.0.3-0"
+ VERSION="v8.1.0"
Gordon Bleux
Gordon Bleux
2 years ago
Make cache directory configurable (#717) Read the cache directory from the environment, falling back to a location under `N_PREFIX`
README.md
Changed around line 255: To change the location to say `$HOME/.n`, add lines like the following to your s
+ If you want to store the downloads under a different location, use `N_CACHE_PREFIX`. This does *not* affect the currently active
+ node version.
+
bin/n
Changed around line 66: VERSION="v8.0.3-0"
- readonly CACHE_DIR=$N_PREFIX/n/versions
+
+ N_CACHE_PREFIX="${N_CACHE_PREFIX-${N_PREFIX}}"
+ N_CACHE_PREFIX=${N_CACHE_PREFIX%/}
+ CACHE_DIR="${N_CACHE_PREFIX}/n/versions"
+ readonly N_CACHE_PREFIX CACHE_DIR
test/tests/install-contents.bats
Changed around line 42: function setup() {
+
+ @test "install: cache prefix" {
+ readonly N_CACHE_PREFIX="$(mktemp -d)"
+ readonly TARGET_VERSION="4.9.1"
+ setup_tmp_prefix
+ export N_CACHE_PREFIX
+
+ [ ! -d "${N_CACHE_PREFIX}/n/versions/node/${TARGET_VERSION}" ]
+ [ ! -d "${N_PREFIX}/n/versions/node/${TARGET_VERSION}" ]
+
+ n ${TARGET_VERSION}
+
+ # Cached version
+ [ -d "${N_CACHE_PREFIX}/n/versions/node/${TARGET_VERSION}" ]
+ [ ! -d "${N_PREFIX}/n/versions/node/${TARGET_VERSION}" ]
+
+ rm -rf "${TMP_PREFIX_DIR}" "${N_CACHE_PREFIX}"
+ }
test/tests/shared-functions.bash
Changed around line 7
+ unset N_CACHE_PREFIX
John Gee
John Gee
3 years ago
Merge remote-tracking branch 'origin/master' into develop
华晨
华晨
3 years ago
Update China Mirror URL to the New Version (#708) npm.taobao.org is now redirect to npmmirror.com, use the new URL instead.
README.md
Changed around line 223: Display diagnostics to help resolve problems:
- export N_NODE_MIRROR=https://npm.taobao.org/mirrors/node
+ export N_NODE_MIRROR=https://npmmirror.com/mirrors/node
John Gee
John Gee
3 years ago
Post-release
CHANGELOG.md
Changed around line 7: and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
+ ## Unreleased (date goes here)
+
bin/n
Changed around line 61: function n_grep() {
- VERSION="v8.0.2"
+ VERSION="v8.0.3-0"
package-lock.json
Changed around line 1
- "version": "8.0.2",
+ "version": "8.0.3-0",
package.json
Changed around line 1
- "version": "8.0.2",
+ "version": "8.0.3-0",
John Gee
John Gee
3 years ago
8.0.2
package-lock.json
Changed around line 1
- "version": "8.0.2-0",
+ "version": "8.0.2",
package.json
Changed around line 1
- "version": "8.0.2-0",
+ "version": "8.0.2",
John Gee
John Gee
3 years ago
Add quoting (per ShellCheck)
bin/n
Changed around line 1273: function display_remote_versions() {
- version="${version#${g_mirror_folder_name}/}"
+ version="${version#"${g_mirror_folder_name}"/}"
John Gee
John Gee
3 years ago
Prepare for release
CHANGELOG.md
Changed around line 7: and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- ## [Unreleased] (date goes here)
+ ## [8.0.2] (2022-01-09)
- ## [8.0.1] (2011-12-04)
+ ### Fixed
+
+ - improved warning message when utility location hash may be holding old location to cover a wider range of shells including dash ([#707])
+
+ ## [8.0.1] (2021-12-04)
Changed around line 435: Only minor functional changes, but technically could break scripts relying on sp
+ [#707]: https://github.com/tj/n/issues/707
+ [8.0.2]: https://github.com/tj/n/compare/v8.0.1...v8.0.2
bin/n
Changed around line 61: function n_grep() {
- VERSION="v8.0.2-0"
+ VERSION="v8.0.2"
Alfonso Gómez-Arzola
Alfonso Gómez-Arzola
3 years ago
GH-706 Update location change message (#707) * GH-706 Update location change message * Remove (seemingly) unnecessary shellcheck exception * Add missing trailing newline
bin/n
Changed around line 740: activate() {
- # shellcheck disable=SC2016
- printf 'To reset the command location hash either start a new shell, or execute PATH="$PATH"\n'
+ printf 'If "node --version" shows the old version then start a new shell, or reset the location hash with:\nhash -r (for bash, zsh, ash, dash, and ksh)\nrehash (for csh and tcsh)\n'
John Gee
John Gee
3 years ago
Post-release
CHANGELOG.md
Changed around line 7: and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
+ ## [Unreleased] (date goes here)
+
bin/n
Changed around line 61: function n_grep() {
- VERSION="v8.0.1"
+ VERSION="v8.0.2-0"
package-lock.json
Changed around line 1
- "version": "8.0.1",
+ "version": "8.0.2-0",
package.json
Changed around line 1
- "version": "8.0.1",
+ "version": "8.0.2-0",
John Gee
John Gee
3 years ago
8.0.1
package-lock.json
Changed around line 1
- "version": "8.0.1-0",
+ "version": "8.0.1",
package.json
Changed around line 1
- "version": "8.0.1-0",
+ "version": "8.0.1",
John Gee
John Gee
3 years ago
Prepeare for release
CHANGELOG.md
Changed around line 7: and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- ## [Unreleased] (date goes here)
+ ## [8.0.1] (2011-12-04)
+
+ ### Fixed
+
+ - improve error handling for tar extraction errors ([#701])
+ - add tar flag for compatibility with tar builds which do not default to stdin ([#697])
Changed around line 427: Only minor functional changes, but technically could break scripts relying on sp
+ [#697]: https://github.com/tj/n/issues/697
+ [#701]: https://github.com/tj/n/issues/701
+ [8.0.1]: https://github.com/tj/n/compare/v8.0.0...v8.0.1
bin/n
Changed around line 61: function n_grep() {
- VERSION="v8.0.1-0"
+ VERSION="v8.0.1"
John Gee
John Gee
3 years ago
Add check for tar error (e.g. decompression problem) (#701)
bin/n
Changed around line 762: install() {
+ # Note: decompression flags ignored with default Darwin tar which autodetects.
Changed around line 791: install() {
- if [[ "${PIPESTATUS[0]}" -ne 0 ]]; then
+ pipe_results=( "${PIPESTATUS[@]}" )
+ if [[ "${pipe_results[0]}" -ne 0 ]]; then
+ if [[ "${pipe_results[1]}" -ne 0 ]]; then
+ abort "failed to extract archive for $version"
+ fi
John Gee
John Gee
3 years ago
Explicitly tell tar to read from stdin (#697)
bin/n
Changed around line 789: install() {
- do_get "${url}" | tar "$tarflag" --strip-components=1 --no-same-owner
+ do_get "${url}" | tar "$tarflag" --strip-components=1 --no-same-owner -f -
Kerollos Magdy
Kerollos Magdy
3 years ago
Fix a typo in a comment (#695)
bin/n
Changed around line 337: enter_fullscreen() {
- # Restore screen contentsq
+ # Restore screen contents
John Gee
John Gee
3 years ago
Post-release
CHANGELOG.md
Changed around line 7: and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
+ ## [Unreleased] (date goes here)
+
bin/n
Changed around line 61: function n_grep() {
- VERSION="v8.0.0"
+ VERSION="v8.0.1-0"
package-lock.json
Changed around line 1
- "version": "8.0.0",
+ "version": "8.0.1-0",
package.json
Changed around line 1
- "version": "8.0.0",
+ "version": "8.0.1-0",
John Gee
John Gee
3 years ago
8.0.0
package-lock.json
Changed around line 1
- "version": "7.5.1-0",
+ "version": "8.0.0",
package.json
Changed around line 1
- "version": "7.5.1-0",
+ "version": "8.0.0",
John Gee
John Gee
3 years ago
Prepare for release
CHANGELOG.md
Changed around line 7: and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- ## [Unreleased] (date goes here)
+ ## [8.0.0] (2021-10-23)
+
+ ### Changed
+
+ - display error if version missing in version file for `n auto` and `n engine` (rather than fallback to current) ([#693])
Changed around line 419: Only minor functional changes, but technically could break scripts relying on sp
+ [#693]: https://github.com/tj/n/issues/693
+ [8.0.0]: https://github.com/tj/n/compare/v7.5.0...v8.0.0
bin/n
Changed around line 61: function n_grep() {
- VERSION="v7.5.1-0"
+ VERSION="v8.0.0"
John Gee
John Gee
3 years ago
Fail for blank target from auto (or engine) version file (#693) * Fail unspecified auto rather than fall back to current * Simplify wording
bin/n
Changed around line 1071: function get_package_engine_version() {
- if [[ -z "${range}" || "*" == "${range}" ]]; then
+ [[ -n "${range}" ]] || return 2
+ if [[ "*" == "${range}" ]]; then
Changed around line 1143: function get_engine_version() {
+ [[ -n "${g_target_node}" ]] || abort "did not find supported version of node in 'engines' field of package.json"
Changed around line 1171: function get_auto_version() {
+ [[ -n "${g_target_node}" ]] || abort "file found for auto did not contain target version of node"
John Gee
John Gee
3 years ago
Post release
CHANGELOG.md
Changed around line 7: and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
+ ## [Unreleased] (date goes here)
+
bin/n
Changed around line 61: function n_grep() {
- VERSION="v7.5.0"
+ VERSION="v7.5.1-0"
package-lock.json
Changed around line 1
- "version": "7.5.0",
+ "version": "7.5.1-0",
package.json
Changed around line 1
- "version": "7.5.0",
+ "version": "7.5.1-0",
John Gee
John Gee
3 years ago
7.5.0
package-lock.json
Changed around line 1
- "version": "7.4.2-0",
+ "version": "7.5.0",
package.json
Changed around line 1
- "version": "7.4.2-0",
+ "version": "7.5.0",
John Gee
John Gee
3 years ago
Prepare for release
CHANGELOG.md
Changed around line 7: and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- ## [Unreleased] (date goes here)
+ ## [7.5.0] (2021-09-26)
+
+ ### Added
+
+ - support for Corepack (which was added to Node.js in v16.9.0)
Changed around line 93: Released off wrong branch, essentially same as 7.1.0.
- `engine` label to look for `engines.node` in `package.json` (as used by`auto`) ([#644])
- -
+
- avoid colorized grep output via `GREP_OPTIONS` breaking version lookup ([#643])
Changed around line 417: Only minor functional changes, but technically could break scripts relying on sp
+ [7.5.0]: https://github.com/tj/n/compare/v7.4.1...v7.5.0
bin/n
Changed around line 61: function n_grep() {
- VERSION="v7.4.2-0"
+ VERSION="v7.5.0"
John Gee
John Gee
3 years ago
Add support for corepack (#686) * Add support for corepack * Use -R with cp to get symlinks copied correctly * Test for same directory as copying * Add comments
bin/n
Changed around line 688: activate() {
+ # Takes same steps for corepack (experimental in node 16.9.0) as for npm, to avoid version problems.
+ if [[ -e "$dir/lib/node_modules/corepack" ]]; then
+ mkdir -p "$N_PREFIX/lib/node_modules"
+ clean_copy_folder "$dir/lib/node_modules/corepack" "$N_PREFIX/lib/node_modules/corepack"
+ fi
- # Copy just node, in case user has installed global npm modules into cache.
+ # Copy bin items by hand, in case user has installed global npm modules into cache.
+ [[ -e "$dir/bin/corepack" ]] && cp -fR "$dir/bin/corepack" "$N_PREFIX/bin" # from 16.9.0
Changed around line 1335: uninstall_installed() {
+ delete_with_echo "${N_PREFIX}/bin/corepack"
+ delete_with_echo "${N_PREFIX}/lib/node_modules/corepack"
John Gee
John Gee
3 years ago
Merge branch 'paulvi-patch-1' into develop
John Gee
John Gee
3 years ago
Rework install location description
README.md
Changed around line 37: If you already have Node.js installed, an easy way to install `n` is using `npm`
- Once installed, `n` caches Node.js versions in subdirectory `n/versions` of the directory specified in environment variable `N_PREFIX`, which defaults to `/usr/local`.
-
- The _active_ Node.js version is installed under `N_PREFIX`. (This creates subdirectories `bin`, `include`, `lib` and `share`.)
+ The `n` command downloads and installs to `/usr/local` by default, but you may override this location by defining `N_PREFIX`.
+ `n` caches Node.js versions in subdirectory `n/versions`. The _active_ Node.js version is installed in subdirectories `bin`, `include`, `lib`, and `share`.
Changed around line 70: to install `n` to `bin/n` of the directory specified in the environment variable
-
+
Changed around line 233: There is also `N_NODE_DOWNLOAD_MIRROR` for a different mirror with same layout a
- By default `n` picks the binaries matching your system architecture. For example, on a 64 bit system `n` will download 64 bit binaries.
+ By default `n` picks the binaries matching your system architecture. For example, on a 64 bit system `n` will download 64 bit binaries.
+
- for Node.js 16 and higher, `n` defaults to arm64 binaries which run natively
- for older versions of Node.js, `n` defaults to x64 binaries which run in Rosetta 2
Paul Verest
Paul Verest
3 years ago
README - clearer show what directories are created under N_PREFIX
README.md
Changed around line 37: If you already have Node.js installed, an easy way to install `n` is using `npm`
- Once installed, `n` caches Node.js versions in subdirectory `n/versions` of the directory specified in environment variable `N_PREFIX`, which defaults to `/usr/local`; and the _active_ Node.js version is installed under `N_PREFIX`.
+ Once installed, `n` caches Node.js versions in subdirectory `n/versions` of the directory specified in environment variable `N_PREFIX`, which defaults to `/usr/local`.
+
+ The _active_ Node.js version is installed under `N_PREFIX`. (This creates subdirectories `bin`, `include`, `lib` and `share`.)
John Gee
John Gee
3 years ago
Post release
CHANGELOG.md
Changed around line 7: and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
+ ## [Unreleased] (date goes here)
+
bin/n
Changed around line 61: function n_grep() {
- VERSION="v7.4.1"
+ VERSION="v7.4.2-0"
package-lock.json
Changed around line 1
- "version": "7.4.1",
+ "version": "7.4.2-0",
package.json
Changed around line 1
- "version": "7.4.1",
+ "version": "7.4.2-0",
John Gee
John Gee
3 years ago
7.4.1
package-lock.json
Changed around line 1
- "version": "7.4.1-0",
+ "version": "7.4.1",
package.json
Changed around line 1
- "version": "7.4.1-0",
+ "version": "7.4.1",
John Gee
John Gee
3 years ago
run commands from correct directory after `--download` causes a download
CHANGELOG.md
Changed around line 7: and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- ## [Unreleased] (date goes here)
+ ## [7.4.1] (2021-09-11)
+
+ ### Fixed
+
+ - run commands from correct directory after `--download` causes a download
Changed around line 411: Only minor functional changes, but technically could break scripts relying on sp
+ [7.4.1]: https://github.com/tj/n/compare/v7.4.0...v7.4.1
bin/n
Changed around line 61: function n_grep() {
- VERSION="v7.4.1-0"
+ VERSION="v7.4.1"
Changed around line 894: function find_cached_version() {
- install "${version}"
+ (install "${version}")
John Gee
John Gee
3 years ago
Add link to CHANGELOG
CHANGELOG.md
Changed around line 13: and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- - support for `--download` option to `run` and `exec` to download the target version when needed
+ - support for `--download` option to `run` and `exec` to download the target version when needed ([#685])
Changed around line 402: Only minor functional changes, but technically could break scripts relying on sp
+ [#685]: https://github.com/tj/n/issues/685
John Gee
John Gee
3 years ago
Post-release
CHANGELOG.md
Changed around line 7: and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
+ ## [Unreleased] (date goes here)
+
bin/n
Changed around line 61: function n_grep() {
- VERSION="7.4.0"
+ VERSION="v7.4.1-0"
package-lock.json
Changed around line 1
- "version": "7.4.0",
+ "version": "7.4.1-0",
package.json
Changed around line 1
- "version": "7.4.0",
+ "version": "7.4.1-0",
John Gee
John Gee
3 years ago
7.4.0
package-lock.json
Changed around line 1
- "version": "7.3.2-0",
+ "version": "7.4.0",
package.json
Changed around line 1
- "version": "7.3.2-0",
+ "version": "7.4.0",
John Gee
John Gee
3 years ago
Prepare 7.4.0
CHANGELOG.md
Changed around line 7: and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- ## [Unreleased] (date goes here)
+ ## [7.4.0] (2021-09-10)
+
+ ### Added
+
+ - support for `--download` option to `run` and `exec` to download the target version when needed
Changed around line 404: Only minor functional changes, but technically could break scripts relying on sp
+ [7.4.0]: https://github.com/tj/n/compare/v7.3.1...v7.4.0
bin/n
Changed around line 61: function n_grep() {
- VERSION="7.3.2-0"
+ VERSION="7.4.0"
John Gee
John Gee
3 years ago
Add support for opt-in download to exec and run (#685) * Rework argument parsing to allow options after exec and run * Add option for run and exec to download missing version * Reword download to cover wider functionality * Be consistent with inner spacing of arrays * Add download test for run and exec
bin/n
Changed around line 115: if [ -n "$HTTP_USER" ];then
- CURL_OPTIONS+=("-u $HTTP_USER:$HTTP_PASSWORD")
- WGET_OPTIONS+=("--http-password=$HTTP_PASSWORD"
- "--http-user=$HTTP_USER")
+ CURL_OPTIONS+=( "-u $HTTP_USER:$HTTP_PASSWORD" )
+ WGET_OPTIONS+=( "--http-password=$HTTP_PASSWORD"
+ "--http-user=$HTTP_USER" )
Changed around line 128: g_active_node=
- ACTIVATE=true
+ DOWNLOAD=false # set to opt-out of activate (install), and opt-in to download (run, exec)
Changed around line 387: Options:
- h, --help Display help information
- p, --preserve Preserve npm and npx during install of Node.js
- q, --quiet Disable curl output. Disable log messages processing "auto" and "engine" labels.
- -d, --download Download only
+ -d, --download Download if necessary, and don't make active
- a, --arch Override system architecture
- -all ls-remote displays all matches instead of last 20
- -insecure Turn off certificate checking for https requests (may be needed from behind a proxy server)
Changed around line 764: install() {
- if "$ACTIVATE" ; then
+ if [[ "$DOWNLOAD" == "false" ]] ; then
Changed around line 792: install() {
- if "$ACTIVATE" ; then
+ if [[ "$DOWNLOAD" == "false" ]]; then
Changed around line 893: function find_cached_version() {
+ if [[ ! -d "${g_cached_version}" && "${DOWNLOAD}" == "true" ]]; then
+ install "${version}"
+ fi
Changed around line 1530: function show_diagnostics() {
+ positional_arg="false"
Changed around line 1538: while [[ $# -ne 0 ]]; do
- V|--version) display_n_version ;;
- h|--help|help) display_help; exit ;;
- q|--quiet) set_quiet ;;
- -d|--download) ACTIVATE=false ;;
+ -d|--download) DOWNLOAD="true" ;;
- -insecure) set_insecure ;;
- p|--preserve) N_PRESERVE_NPM="true" ;;
- -no-preserve) N_PRESERVE_NPM="" ;;
Changed around line 1548: while [[ $# -ne 0 ]]; do
- -stable) display_remote_versions lts; exit ;; # [sic] old terminology
- -lts) display_remote_versions lts; exit ;;
- a|--arch) shift; set_arch "$1";; # set arch and continue
- exec) unprocessed_args=("$@"); break ;;
- run|as|use) unprocessed_args=("$@"); break ;;
- *) unprocessed_args+=( "$1" ) ;;
+ exec|run|as|use)
+ unprocessed_args+=( "$1" )
+ positional_arg="true"
+ ;;
+ *)
+ if [[ "${positional_arg}" == "true" ]]; then
+ unprocessed_args+=( "$@" )
+ break
+ fi
+ unprocessed_args+=( "$1" )
+ ;;
test/tests/run-which.bats
Changed around line 11: function setup_file() {
+ # using "latest" for download tests with run and exec
-
Changed around line 37: function teardown_file() {
-
-
-
Changed around line 61: function teardown_file() {
-
-
-
-
+ @test "n run --download latest" {
+ n rm latest || true
+ n run --download latest --version
+ output="$(n run latest --version)"
+ local LATEST_VERSION="$(display_remote_version latest)"
+ assert_equal "$output" "v${LATEST_VERSION}"
+ }
Changed around line 93: function teardown_file() {
-
-
+
+ @test "n exec -d latest" {
+ n rm latest || true
+ n exec -d latest node --version
+ output="$(n exec latest node --version)"
+ local LATEST_VERSION="$(display_remote_version latest)"
+ assert_equal "$output" "v${LATEST_VERSION}"
+ }
John Gee
John Gee
3 years ago
Merge branch 'develop' of github.com:tj/n into develop
John Gee
John Gee
3 years ago
Improve README, and resolve #684
README.md
Changed around line 33: It is written as a BASH script but does not require you to use BASH as your comm
- Since you probably already have `node`, the easiest way to install `n` is through `npm`:
+ If you already have Node.js installed, an easy way to install `n` is using `npm`:
Changed around line 56: If `npm` is not yet available, one way to bootstrap an install:
+ npm install -g n
즈눅
즈눅
3 years ago
Remove duplicated explanation of `n run` (#682)
bin/n
Changed around line 371: Commands:
- n run [args ...] Execute downloaded node with [args ...]
John Gee
John Gee
3 years ago
Post-release
CHANGELOG.md
Changed around line 7: and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
+ ## [Unreleased] (date goes here)
+
bin/n
Changed around line 61: function n_grep() {
- VERSION="7.3.1"
+ VERSION="7.3.2-0"
package-lock.json
Changed around line 1
- "version": "7.3.1",
+ "version": "7.3.2-0",
package.json
Changed around line 1
- "version": "7.3.1",
+ "version": "7.3.2-0",
John Gee
John Gee
3 years ago
7.3.1
package-lock.json
Changed around line 1
- "version": "7.3.1-0",
+ "version": "7.3.1",
package.json
Changed around line 1
- "version": "7.3.1-0",
+ "version": "7.3.1",
John Gee
John Gee
3 years ago
Prepare for release
CHANGELOG.md
Changed around line 7: and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- ## Unreleased (date goes here)
+ ## [7.3.1] (2021-07-25)
+
+ ### Changed
+
+ - Improved README for new users missing expected folders in `/usr/local` ([#679])
Changed around line 393: Only minor functional changes, but technically could break scripts relying on sp
+ [#679]: https://github.com/tj/n/issues/679
+ [7.3.1]: https://github.com/tj/n/compare/v7.3.0...v7.3.1
bin/n
Changed around line 61: function n_grep() {
- VERSION="7.3.1-0"
+ VERSION="7.3.1"
Luca Ban
Luca Ban
3 years ago
fix: #679 (#680)
README.md
Changed around line 44: To avoid requiring `sudo` for `n` and `npm` global installs, it is suggested you
+ # make sure the required folders exist (safe to execute even if they already exist)
+ sudo mkdir -p /usr/local/bin /usr/local/lib /usr/local/include /usr/local/share
John Gee
John Gee
3 years ago
Post release
CHANGELOG.md
Changed around line 7: and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
+ ## Unreleased (date goes here)
+
bin/n
Changed around line 61: function n_grep() {
- VERSION="7.3.0"
+ VERSION="7.3.1-0"
package-lock.json
Changed around line 1
- "version": "7.3.0",
+ "version": "7.3.1-0",
package.json
Changed around line 1
- "version": "7.3.0",
+ "version": "7.3.1-0",
John Gee
John Gee
3 years ago
7.3.0
package-lock.json
Changed around line 1
- "version": "7.2.3-0",
+ "version": "7.3.0",
package.json
Changed around line 1
- "version": "7.2.3-0",
+ "version": "7.3.0",
John Gee
John Gee
3 years ago
Merge branch 'develop' of github.com:tj/n into develop
John Gee
John Gee
3 years ago
Prepare for release
CHANGELOG.md
Changed around line 7: and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- ## [Unreleased] (date goes here)
+ ## [7.3.0] (2021-06-06)
+
+ ### Added
+
+ - ls-remote supports `engine` and `auto` labels ([#675])
+ - reduce `engine` and `auto` logging with `--quiet` ([#675])
+ - add WSL support to README ([#676])
+ - support for Emacs up and down keys (`ctrl-p` and `ctrl-n`) ([#669])
+
+ ### Changed
+
+ - diagnostic logging during processing of engine and auto written to stderr rather than stdout ([#675])
Changed around line 384: Only minor functional changes, but technically could break scripts relying on sp
+ [#669]: https://github.com/tj/n/pull/669
+ [#675]: https://github.com/tj/n/pull/675
+ [#676]: https://github.com/tj/n/pull/676
+ [7.3.0]: https://github.com/tj/n/compare/v7.2.2...v7.3.0
bin/n
Changed around line 61: function n_grep() {
- VERSION="7.2.3-0"
+ VERSION="7.3.0"