Repository: nvm
Issue: Cannot install node on macOS
Labels: installing node,needs followup

<!-- Thank you for being interested in nvm! Please help us by filling out the following form if you‘re having trouble. If you have a feature request, or some other question, please feel free to clear out the form. Thanks! -->

#### Operating system and version:

#### `nvm debug` output:
<details>
<!-- do not delete the following blank line -->

```sh
﻿﻿nvm --version: v0.39.2
$SHELL: /bin/zsh
$SHLVL: 1
whoami: 'kret'
${HOME}: /Users/kret
${NVM_DIR}: '${HOME}/.nvm'
${PATH}: ${HOME}/.nix-profile/bin:${HOME}/.opam/default/bin:${HOME}/.rbenv/shims:${NVM_DIR}/versions/node/v18.10.0/bin:${HOME}/.jenv/shims:${HOME}/.asdf/shims:/usr/local/opt/asdf/libexec/bin:${HOME}/bin:${HOME}/.cabal/bin:${HOME}/.ghcup/bin:${HOME}/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin
$PREFIX: ''
${NPM_CONFIG_PREFIX}: ''
$NVM_NODEJS_ORG_MIRROR: ''
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'zsh 5.8.1 (x86_64-apple-darwin21.0)'
uname -a: 'Darwin 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:17:10 PDT 2022; root:xnu-8020.140.49~2/RELEASE_X86_64 x86_64'
checksum binary: 'sha256sum'
OS version: macOS 12.6 21G115
curl: /usr/bin/curl, curl 7.79.1 (x86_64-apple-darwin21.0) libcurl/7.79.1 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.11 nghttp2/1.45.1
wget: not found
sed: /usr/bin/sed
cut: /usr/bin/cut
basename: /usr/bin/basename
rm: rm: aliased to rm -i (rm -i)
mkdir: /bin/mkdir
xargs: /usr/bin/xargs
git: /usr/local/bin/git, git version 2.38.1
ls: grep:: No such file or directory
grep: grep: aliased to grep --color (grep --color), grep (BSD grep, GNU compatible) 2.6.0-FreeBSD
awk: /usr/bin/awk, awk version 20200816
nvm current: v18.10.0
which node: ${NVM_DIR}/versions/node/v18.10.0/bin/node
which iojs: iojs not found
which npm: ${NVM_DIR}/versions/node/v18.10.0/bin/npm
npm config get prefix: ${NVM_DIR}/versions/node/v18.10.0
npm root -g: ${NVM_DIR}/versions/node/v18.10.0/lib/node_modules
```
</details>

#### `nvm ls` output:
<details>
<!-- do not delete the following blank line -->

```sh
       v16.13.1
->     v18.10.0
         system
default -> node (-> v18.10.0)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v18.10.0) (default)
stable -> 18.10 (-> v18.10.0) (default)
lts/* -> lts/gallium (-> N/A)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.24.1 (-> N/A)
lts/erbium -> v12.22.12 (-> N/A)
lts/fermium -> v14.20.1 (-> N/A)
lts/gallium -> v16.18.0 (-> N/A)
```
</details>

#### How did you install `nvm`?
<!-- (e.g. install script in readme, Homebrew) -->
Install script in readme, v0.35.1, kept updated via `zsh-nvm` plugin.

#### What steps did you perform?
Ran `nvm install node --reinstall-packages-from=node` and instead of usual installation of node a very long error output was displayed (see next section).
Same thing happened when using other recent node version numbers: 16, 17, 18.
Also when I removed the `--reinstall-packages-from` parameter.
Also when I run `nvm install -b node`.

#### What happened?


<details>
<!-- do not delete the following blank line -->

```sh
Downloading and installing node v19.0.0...
awk: non-terminated string node-v19.0... at source line 1
 context is
	{ if ("node-v19.0.0-darwin-integer 10 readonly '!'=74621 >>>
 <<<
awk: non-terminated string node-v19.0... at source line 2
awk: non-terminated string node-v19.0... at source line 3
mkdir: /Users/kret/.nvm/.cache/bin/node-v19.0.0-darwin-integer 10 readonly '!'=74621
integer 10 readonly '#'=0
integer 10 readonly '$'=74222
array readonly '*'=(  )
readonly -=3569JNRXghikls
0=nvm_get_arch
integer 10 readonly '?'=0
array readonly @=(  )
local ADDITIONAL_PARAMETERS=''
ALACRITTY_LOG=: File name too long
creating directory /Users/kret/.nvm/.cache/bin/node-v19.0.0-darwin-integer 10 readonly '!'=74621
...
...goes on for maaany lines
...
```
</details>

Eventually requested node version was not installed.

#### What did you expect to happen?

I expected the requested binary node distribution of Mac OS to be downloaded, installed and made available via nvm, as usually so far.

#### Is there anything in any of your profile files that modifies the `PATH`?
<!--  (e.g. `.bashrc`, `.bash_profile`, `.zshrc`, etc) -->
In my `.zshrc` I have at the top: `export PATH=$HOME/bin:$HOME/.cabal/bin:$HOME/.ghcup/bin:$HOME/.local/bin:$PATH`

<!-- Please remove the following section if it does not apply to you -->
#### If you are having installation issues, or getting "N/A", what does `curl -I --compressed -v https://nodejs.org/dist/` print out?
<details>
<!-- do not delete the following blank line -->

```sh

```
</details>