nvm: getting error on running `nvm install 14` on mac

Operating system and version: Mac os v12.5

nvm debug output:

nvm --version: v0.39.2
$TERM_PROGRAM: iTerm.app
$SHELL: /bin/zsh
$SHLVL: 1
whoami: 'msuhail'
${HOME}: /Users/msuhail
${NVM_DIR}: '${HOME}/.nvm'
${PATH}: ${HOME}/git/kirkstrobeck/stash/scripts/git:/opt/homebrew/bin:${NVM_DIR}/versions/node/v18.12.1/bin:${HOME}/.pyenv/shims:${HOME}/.pyenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin:/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: Sat Jun 18 17:07:22 PDT 2022; root:xnu-8020.140.41~1/RELEASE_ARM64_T6000 arm64'
checksum binary: 'sha256sum'
OS version: macOS 12.5 21G72
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: /opt/homebrew/bin/wget, GNU Wget 1.21.3 built on darwin21.3.0.
sed: /usr/bin/sed
cut: /usr/bin/cut
basename: /usr/bin/basename
rm: /bin/rm
mkdir: /bin/mkdir
xargs: /usr/bin/xargs
git: /opt/homebrew/bin/git, git version 2.38.1
ls: grep:: No such file or directory
grep: grep: aliased to grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn,.idea,.tox} (grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn,.idea,.tox}), grep (BSD grep, GNU compatible) 2.6.0-FreeBSD
awk: /usr/bin/awk, awk version 20200816
nvm current: v18.12.1
which node: ${NVM_DIR}/versions/node/v18.12.1/bin/node
which iojs: iojs not found
which npm: /opt/homebrew/bin/npm
npm config get prefix: /opt/homebrew
npm root -g: /opt/homebrew/lib/node_modules

nvm ls output:

        v14.0.0
       v15.14.0
->     v18.12.1
         system
default -> lts/* (-> v18.12.1)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v18.12.1) (default)
stable -> 18.12 (-> v18.12.1) (default)
lts/* -> lts/hydrogen (-> v18.12.1)
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.21.1 (-> N/A)
lts/gallium -> v16.18.1 (-> N/A)
lts/hydrogen -> v18.12.1

How did you install nvm?

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash

What steps did you perform?

nvm install 14.21.1

What happened?

getting below error

Found '/Users/msuhail/git/better/mortgage/barrel/.nvmrc' with version <v14>
Downloading and installing node v14.21.1...
Downloading https://nodejs.org/dist/v14.21.1/node-v14.21.1-darwin-arm64.tar.xz...
#=#=-  #       #                                                                                                                                                                                                                                               #=O#-     #        #                                                                                                                                                                                                                                           -#O=- #      #          #                                                                                                                                                                                                                                      -=O#-   #        #           #                                                                                                                                                                                                                                 curl: (22) The requested URL returned error: 404

Binary download from https://nodejs.org/dist/v14.21.1/node-v14.21.1-darwin-arm64.tar.xz failed, trying source.
grep: /Users/msuhail/.nvm/.cache/bin/node-v14.21.1-darwin-arm64/node-v14.21.1-darwin-arm64.tar.xz: No such file or directory
Provided file to checksum does not exist.
Binary download failed, trying source.
Detected that you have 10 CPU core(s)
Running with 9 threads to speed up the build
Clang v3.5+ detected! CC or CXX not specified, will use Clang as C/C++ compiler!
Local cache found: ${NVM_DIR}/.cache/src/node-v14.21.1/node-v14.21.1.tar.xz
Checksums match! Using existing downloaded archive ${NVM_DIR}/.cache/src/node-v14.21.1/node-v14.21.1.tar.xz
$>./configure --prefix=/Users/msuhail/.nvm/versions/node/v14.21.1 <
Node.js configure: Found Python 3.10.8...
INFO: configure completed successfully
/Library/Developer/CommandLineTools/usr/bin/make -C out BUILDTYPE=Release V=0
  c++ -o /Users/msuhail/.nvm/.cache/src/node-v14.21.1/files/out/Release/obj.target/icuucx/deps/icu-small/source/common/ubrk.o ../deps/icu-small/source/common/ubrk.cpp '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-DNODE_OPENSSL_CONF_NAME=nodejs_conf' '-D_DARWIN_USE_64_BIT_INODE=1' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DU_COMMON_IMPLEMENTATION=1' '-DU_ATTRIBUTE_DEPRECATED=' '-D_CRT_SECURE_NO_DEPRECATE=' '-DU_STATIC_IMPLEMENTATION=1' '-DUCONFIG_NO_SERVICE=1' '-DU_ENABLE_DYLOAD=0' '-DU_HAVE_STD_STRING=1' '-DUCONFIG_NO_BREAK_ITERATION=0' -I../deps/icu-small/source/common  -O3 -gdwarf-2 -mmacosx-version-min=10.13 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++1y -stdlib=libc++ -fno-exceptions -fno-strict-aliasing -MMD -MF /Users/msuhail/.nvm/.cache/src/node-v14.21.1/files/out/Release/.deps//Users/msuhail/.nvm/.cache/src/node-v14.21.1/files/out/Release/obj.target/icuucx/deps/icu-small/source/common/ubrk.o.d.raw   -c
  c++ -o /Users/msuhail/.nvm/.cache/src/node-v14.21.1/files/out/Release/obj.target/icuucx/deps/icu-small/source/common/ucnv_bld.o ../deps/icu-small/source/common/ucnv_bld.cpp '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-DNODE_OPENSSL_CONF_NAME=nodejs_conf' '-D_DARWIN_USE_64_BIT_INODE=1' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DU_COMMON_IMPLEMENTATION=1' '-DU_ATTRIBUTE_DEPRECATED=' '-D_CRT_SECURE_NO_DEPRECATE=' '-DU_STATIC_IMPLEMENTATION=1' '-DUCONFIG_NO_SERVICE=1' '-DU_ENABLE_DYLOAD=0' '-DU_HAVE_STD_STRING=1' '-DUCONFIG_NO_BREAK_ITERATION=0' -I../deps/icu-small/source/common  -O3 -gdwarf-2 -mmacosx-version-min=10.13 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++1y -stdlib=libc++ -fno-exceptions -fno-strict-aliasing -MMD -MF /Users/msuhail/.nvm/.cache/src/node-v14.21.1/files/out/Release/.deps//Users/msuhail/.nvm/.cache/src/node-v14.21.1/files/out/Release/obj.target/icuucx/deps/icu-small/source/common/ucnv_bld.o.d.raw   -c
  c++ -o /Users/msuhail/.nvm/.cache/src/node-v14.21.1/files/out/Release/obj.target/icuucx/deps/icu-small/source/common/charstr.o ../deps/icu-small/source/common/charstr.cpp '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-DNODE_OPENSSL_CONF_NAME=nodejs_conf' '-D_DARWIN_USE_64_BIT_INODE=1' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DU_COMMON_IMPLEMENTATION=1' '-DU_ATTRIBUTE_DEPRECATED=' '-D_CRT_SECURE_NO_DEPRECATE=' '-DU_STATIC_IMPLEMENTATION=1' '-DUCONFIG_NO_SERVICE=1' '-DU_ENABLE_DYLOAD=0' '-DU_HAVE_STD_STRING=1' '-DUCONFIG_NO_BREAK_ITERATION=0' -I../deps/icu-small/source/common  -O3 -gdwarf-2 -mmacosx-version-min=10.13 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++1y -stdlib=libc++ -fno-exceptions -fno-strict-aliasing -MMD -MF /Users/msuhail/.nvm/.cache/src/node-v14.21.1/files/out/Release/.deps//Users/msuhail/.nvm/.cache/src/node-v14.21.1/files/out/Release/obj.target/icuucx/deps/icu-small/source/common/charstr.o.d.raw   -c
  c++ -o /Users/msuhail/.nvm/.cache/src/node-v14.21.1/files/out/Release/obj.target/icuucx/deps/icu-small/source/common/uloc_keytype.o ../deps/icu-small/source/common/uloc_keytype.cpp '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-DNODE_OPENSSL_CONF_NAME=nodejs_conf' '-D_DARWIN_USE_64_BIT_INODE=1' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DU_COMMON_IMPLEMENTATION=1' '-DU_ATTRIBUTE_DEPRECATED=' '-D_CRT_SECURE_NO_DEPRECATE=' '-DU_STATIC_IMPLEMENTATION=1' '-DUCONFIG_NO_SERVICE=1' '-DU_ENABLE_DYLOAD=0' '-DU_HAVE_STD_STRING=1' '-DUCONFIG_NO_BREAK_ITERATION=0' -I../deps/icu-small/source/common  -O3 -gdwarf-2 -mmacosx-version-min=10.13 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++1y -stdlib=libc++ -fno-exceptions -fno-strict-aliasing -MMD -MF /Users/msuhail/.nvm/.cache/src/node-v14.21.1/files/out/Release/.deps//Users/msuhail/.nvm/.cache/src/node-v14.21.1/files/out/Release/obj.target/icuucx/deps/icu-small/source/common/uloc_keytype.o.d.raw   -c
  c++ -o /Users/msuhail/.nvm/.cache/src/node-v14.21.1/files/out/Release/obj.target/icuucx/deps/icu-small/source/common/brkeng.o ../deps/icu-small/source/common/brkeng.cpp '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-DNODE_OPENSSL_CONF_NAME=nodejs_conf' '-D_DARWIN_USE_64_BIT_INODE=1' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DU_COMMON_IMPLEMENTATION=1' '-DU_ATTRIBUTE_DEPRECATED=' '-D_CRT_SECURE_NO_DEPRECATE=' '-DU_STATIC_IMPLEMENTATION=1' '-DUCONFIG_NO_SERVICE=1' '-DU_ENABLE_DYLOAD=0' '-DU_HAVE_STD_STRING=1' '-DUCONFIG_NO_BREAK_ITERATION=0' -I../deps/icu-small/source/common  -O3 -gdwarf-2 -mmacosx-version-min=10.13 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++1y -stdlib=libc++ -fno-exceptions -fno-strict-aliasing -MMD -MF /Users/msuhail/.nvm/.cache/src/node-v14.21.1/files/out/Release/.deps//Users/msuhail/.nvm/.cache/src/node-v14.21.1/files/out/Release/obj.target/icuucx/deps/icu-small/source/common/brkeng.o.d.raw   -c
  c++ -o /Users/msuhail/.nvm/.cache/src/node-v14.21.1/files/out/Release/obj.target/icuucx/deps/icu-small/source/common/ucnv_u8.o ../deps/icu-small/source/common/ucnv_u8.cpp '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-DNODE_OPENSSL_CONF_NAME=nodejs_conf' '-D_DARWIN_USE_64_BIT_INODE=1' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DU_COMMON_IMPLEMENTATION=1' '-DU_ATTRIBUTE_DEPRECATED=' '-D_CRT_SECURE_NO_DEPRECATE=' '-DU_STATIC_IMPLEMENTATION=1' '-DUCONFIG_NO_SERVICE=1' '-DU_ENABLE_DYLOAD=0' '-DU_HAVE_STD_STRING=1' '-DUCONFIG_NO_BREAK_ITERATION=0' -I../deps/icu-small/source/common  -O3 -gdwarf-2 -mmacosx-version-min=10.13 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++1y -stdlib=libc++ -fno-exceptions -fno-strict-aliasing -MMD -MF /Users/msuhail/.nvm/.cache/src/node-v14.21.1/files/out/Release/.deps//Users/msuhail/.nvm/.cache/src/node-v14.21.1/files/out/Release/obj.target/icuucx/deps/icu-small/source/common/ucnv_u8.o.d.raw   -c
  c++ -o /Users/msuhail/.nvm/.cache/src/node-v14.21.1/files/out/Release/obj.target/icuucx/deps/icu-small/source/common/ucnv_ct.o ../deps/icu-small/source/common/ucnv_ct.cpp '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-DNODE_OPENSSL_CONF_NAME=nodejs_conf' '-D_DARWIN_USE_64_BIT_INODE=1' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DU_COMMON_IMPLEMENTATION=1' '-DU_ATTRIBUTE_DEPRECATED=' '-D_CRT_SECURE_NO_DEPRECATE=' '-DU_STATIC_IMPLEMENTATION=1' '-DUCONFIG_NO_SERVICE=1' '-DU_ENABLE_DYLOAD=0' '-DU_HAVE_STD_STRING=1' '-DUCONFIG_NO_BREAK_ITERATION=0' -I../deps/icu-small/source/common  -O3 -gdwarf-2 -mmacosx-version-min=10.13 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++1y -stdlib=libc++ -fno-exceptions -fno-strict-aliasing -MMD -MF /Users/msuhail/.nvm/.cache/src/node-v14.21.1/files/out/Release/.deps//Users/msuhail/.nvm/.cache/src/node-v14.21.1/files/out/Release/obj.target/icuucx/deps/icu-small/source/common/ucnv_ct.o.d.raw   -c

What did you expect to happen?

should be able to install node@14.21.1

Is there anything in any of your profile files that modifies the PATH?

NA

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 3
  • Comments: 19 (5 by maintainers)

Most upvoted comments

To be clear, it’s trying to download darwin arm64, and those don’t exist before node 16 - so if you’re on an M1/M2 mac, you need to be in a Rosetta shell to install node < 16.

@ljharb answer fixed the problem for me.

And here is how to open the Terminal using Rosetta:

  1. Open the Applications folder in Finder.
  2. Click the Search icon and type Terminal.
  3. Right-click the Terminal icon that will appear and select the Get Info option.
  4. From the Get Info window, check the checkbox next to Open using Rosetta.
  5. Close all open windows of the terminal and quit it and then reopen the terminal again.
  6. Now you can try to install Node version < 16 using NVM and it should succeed.

To be clear, it’s trying to download darwin arm64, and those don’t exist before node 16 - so if you’re on an M1/M2 mac, you need to be in a Rosetta shell to install node < 16.

Doesn’t work in 2024 even with rosetta with node 14.21.3 …/deps/v8/src/base/bit-field.h:43:29: error: integer value 31 is outside the valid range of values

Doesn’t work in 2024 even with rosetta with node 14.21.3 …/deps/v8/src/base/bit-field.h:43:29: error: integer value 31 is outside the valid range of values

Try changing the machine’s architecture type from the default arm64 to x86_64

To check the current architecture enter the command below.

arch

If it returns arm64, ether the following command:

arch -x86_64 zsh

Then, try nvm i 14 again. Worked for me on M3 Pro.

To be clear, it’s trying to download darwin arm64, and those don’t exist before node 16 - so if you’re on an M1/M2 mac, you need to be in a Rosetta shell to install node < 16.

@ljharb answer fixed the problem for me.

And here is how to open the Terminal using Rosetta:

1. Open the **Applications** folder in **Finder**.

2. Click the **Search** icon and type **Terminal**.

3. **Right-click** the Terminal icon that will appear and select the **Get Info** option.

4. From the Get Info window, check the checkbox next to **Open using Rosetta**.

5. Close all open windows of the terminal and quit it and then reopen the terminal again.

6. Now you can try to install Node version < 16 using NVM and it should succeed.

This doesn’t work in 2024. The following solution worked: https://stackoverflow.com/a/76399805

To be clear, it’s trying to download darwin arm64, and those don’t exist before node 16 - so if you’re on an M1/M2 mac, you need to be in a Rosetta shell to install node < 16.

it worked, thanks!