nvm-sh / nvm

Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions
MIT License
79.61k stars 7.97k forks source link

Failed to install node using the install command #3387

Closed Live-or closed 3 months ago

Live-or commented 3 months ago

Operating system and version:

macOS Sonoma 14.5

nvm debug output:

```sh nvm --version: v0.39.7 $TERM_PROGRAM: iTerm.app $SHELL: /bin/zsh $SHLVL: 1 whoami: 'lvjunpeng' ${HOME}: /Users/lvjunpeng ${NVM_DIR}: '${HOME}/.nvm' ${PATH}: /Library/Frameworks/Python.framework/Versions/3.9/bin:${HOME}/Applications/Gradle/gradle-8.1.1/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:${HOME}/Library/Application Support/JetBrains/Toolbox/scripts $PREFIX: '' ${NPM_CONFIG_PREFIX}: '' $NVM_NODEJS_ORG_MIRROR: '' $NVM_IOJS_ORG_MIRROR: '' shell version: 'zsh 5.9 (x86_64-apple-darwin23.0)' uname -a: 'Darwin 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64' checksum binary: 'shasum' OS version: macOS 14.5 23F79 awk: /usr/bin/awk, awk version 20200816 curl: /usr/bin/curl, curl 8.6.0 (x86_64-apple-darwin23.0) libcurl/8.6.0 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.12 nghttp2/1.61.0 wget: not found sed: /usr/bin/sed cut: /usr/bin/cut basename: /usr/bin/basename rm: /bin/rm mkdir: /bin/mkdir xargs: /usr/bin/xargs git: /usr/bin/git, git version 2.39.3 (Apple Git-146) grep: /usr/bin/grep, grep (BSD grep, GNU compatible) 2.6.0-FreeBSD nvm current: none which node: node not found which iojs: iojs not found which npm: /opt/homebrew/bin/npm npm config get prefix: env: node: No such file or directory npm root -g: env: node: No such file or directory ```

nvm ls output:

```sh N/A iojs -> N/A (default) node -> stable (-> N/A) (default) unstable -> N/A (default) lts/* -> lts/iron (-> 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.21.3 (-> N/A) lts/gallium -> v16.20.2 (-> N/A) lts/hydrogen -> v18.20.4 (-> N/A) lts/iron -> v20.15.1 (-> N/A) ```

How did you install nvm?

Download the script and run it manually

What steps did you perform?

nvm install v14.20.0

What happened?

The download failed with the following error:

```sh ../deps/v8/src/base/bit-field.h:43:29: error: integer value 31 is outside the valid range of values [0, 15] for this enumeration type [-Wenum-constexpr-conversion] static constexpr T kMax = static_cast(kNumValues - 1); ^ In file included from ../deps/v8/src/compiler/backend/frame-elider.cc:5: In file included from ../deps/v8/src/compiler/backend/frame-elider.h:8: In file included from ../deps/v8/src/compiler/backend/instruction.h:14: In file included from ../deps/v8/src/codegen/external-reference.h:9: In file included from ../deps/v8/src/runtime/runtime.h:11: ../deps/v8/src/base/bit-field.h:43:29: error: integer value 31 is outside the valid range of values [0, 15] for this enumeration type [-Wenum-constexpr-conversion] static constexpr T kMax = static_cast(kNumValues - 1); ^ In file included from ../deps/v8/src/compiler/add-type-assertions-reducer.cc:5: In file included from ../deps/v8/src/compiler/add-type-assertions-reducer.h:9: In file included from ../deps/v8/src/compiler/graph-reducer.h:10: In file included from ../deps/v8/src/compiler/node-marker.h:8: In file included from ../deps/v8/src/compiler/node.h:10: In file included from ../deps/v8/src/compiler/operator.h:15: In file included from ../deps/v8/src/objects/feedback-cell.h:8: In file included from ../deps/v8/src/objects/struct.h:8: In file included from ../deps/v8/src/objects/heap-object.h:9: In file included from ../deps/v8/src/roots/roots.h:9: In file included from ../deps/v8/src/builtins/accessors.h:9: ../deps/v8/src/base/bit-field.h:43:29: error: integer value 31 is outside the valid range of values [0, 15] for this enumeration type [-Wenum-constexpr-conversion] static constexpr T kMax = static_cast(kNumValues - 1); ^ In file included from ../deps/v8/src/compiler/all-nodes.cc:5: In file included from ../deps/v8/src/compiler/all-nodes.h:8: In file included from ../deps/v8/src/compiler/node.h:10: In file included from ../deps/v8/src/compiler/operator.h:15: In file included from ../deps/v8/src/objects/feedback-cell.h:8: In file included from ../deps/v8/src/objects/struct.h:8: In file included from ../deps/v8/src/objects/heap-object.h:9: In file included from ../deps/v8/src/roots/roots.h:9: In file included from ../deps/v8/src/builtins/accessors.h:9: ../deps/v8/src/base/bit-field.h:43:29: error: integer value 31 is outside the valid range of values [0, 15] for this enumeration type [-Wenum-constexpr-conversion] static constexpr T kMax = static_cast(kNumValues - 1);In file included from ../deps/v8/src/compiler/access-builder.cc:5: In file included from ../deps/v8/src/compiler/access-builder.h:9: ^In file included from ../deps/v8/src/compiler/simplified-operator.h:13: In file included from ../deps/v8/src/compiler/feedback-source.h:8: In file included from ../deps/v8/src/compiler/heap-refs.h:9: In file included from ../deps/v8/src/ic/call-optimization.h:8: In file included from ../deps/v8/src/api/api-arguments.h:8: In file included from ../deps/v8/src/api/api.h:10: In file included from ../deps/v8/src/execution/isolate.h:24: In file included from ../deps/v8/src/execution/isolate-data.h:10: In file included from ../deps/v8/src/codegen/external-reference-table.h:10: In file included from ../deps/v8/src/builtins/accessors.h:9: ../deps/v8/src/base/bit-field.h:43:29: error: integer value 31 is outside the valid range of values [0, 15] for this enumeration type [-Wenum-constexpr-conversion] static constexpr T kMax = static_cast(kNumValues - 1); ^ In file included from ../deps/v8/src/compiler/access-info.cc:7: In file included from ../deps/v8/src/compiler/access-info.h:11: In file included from ../deps/v8/src/compiler/types.h:10: In file included from ../deps/v8/src/compiler/heap-refs.h:9: In file included from ../deps/v8/src/ic/call-optimization.h:8: In file included from ../deps/v8/src/api/api-arguments.h:8: In file included from ../deps/v8/src/api/api.h:10: In file included from ../deps/v8/src/execution/isolate.h:24: In file included from ../deps/v8/src/execution/isolate-data.h:10: In file included from ../deps/v8/src/codegen/external-reference-table.h:10: In file included from ../deps/v8/src/builtins/accessors.h:9: ../deps/v8/src/base/bit-field.h:43:29: error: integer value 31 is outside the valid range of values [0, 15] for this enumeration type [-Wenum-constexpr-conversion] static constexpr T kMax = static_cast(kNumValues - 1); ^ In file included from ../deps/v8/src/compiler/backend/gap-resolver.cc:5: In file included from ../deps/v8/src/compiler/backend/gap-resolver.h:8: In file included from ../deps/v8/src/compiler/backend/instruction.h:14: In file included from ../deps/v8/src/codegen/external-reference.h:9: In file included from ../deps/v8/src/runtime/runtime.h:11: ../deps/v8/src/base/bit-field.h:43:29: error: integer value 31 is outside the valid range of values [0, 15] for this enumeration type [-Wenum-constexpr-conversion] static constexpr T kMax = static_cast(kNumValues - 1); ^ ../deps/v8/src/base/bit-field.h:43:29: error: integer value 3 is outside the valid range of values [0, 1] for this enumeration type [-Wenum-constexpr-conversion] 1 error generated. make[1]: *** [/Users/lvjunpeng/.nvm/.cache/src/node-v14.20.0/files/out/Release/obj.target/v8_compiler/deps/v8/src/compiler/all-nodes.o] Error 1 make[1]: *** Waiting for unfinished jobs.... ../deps/v8/src/base/bit-field.h:43:29: error: integer value 3 is outside the valid range of values [0, 1] for this enumeration type [-Wenum-constexpr-conversion] 2 errors generated. make[1]: *** [/Users/lvjunpeng/.nvm/.cache/src/node-v14.20.0/files/out/Release/obj.target/v8_compiler/deps/v8/src/compiler/backend/frame-elider.o] Error 1 ../deps/v8/src/base/bit-field.h:43:29: error: integer value 3 is outside the valid range of values [0, 1] for this enumeration type [-Wenum-constexpr-conversion] 1 error generated. make[1]: *** [/Users/lvjunpeng/.nvm/.cache/src/node-v14.20.0/files/out/Release/obj.target/v8_compiler/deps/v8/src/compiler/add-type-assertions-reducer.o] Error 1 2 errors generated. make[1]: *** [/Users/lvjunpeng/.nvm/.cache/src/node-v14.20.0/files/out/Release/obj.target/v8_compiler/deps/v8/src/compiler/backend/gap-resolver.o] Error 1 ../deps/v8/src/base/bit-field.h:43:29: error: integer value 7 is outside the valid range of values [0, 3] for this enumeration type [-Wenum-constexpr-conversion] ../deps/v8/src/base/bit-field.h:43:29: error: integer value 7 is outside the valid range of values [0, 3] for this enumeration type [-Wenum-constexpr-conversion] ../deps/v8/src/base/bit-field.h:43:29: error: integer value 7 is outside the valid range of values [0, 3] for this enumeration type [-Wenum-constexpr-conversion] 2 errors generated. make[1]: *** [/Users/lvjunpeng/.nvm/.cache/src/node-v14.20.0/files/out/Release/obj.target/v8_compiler/deps/v8/src/compiler/access-builder.o] Error 1 2 errors generated. make[1]: *** [/Users/lvjunpeng/.nvm/.cache/src/node-v14.20.0/files/out/Release/obj.target/v8_compiler/deps/v8/src/compiler/access-info.o] Error 1 3 errors generated. make[1]: *** [/Users/lvjunpeng/.nvm/.cache/src/node-v14.20.0/files/out/Release/obj.target/v8_compiler/deps/v8/src/compiler/backend/code-generator.o] Error 1 rm 4a4268024c7926939c9d11e13d20ae12d6ebaae6.intermediate 66f1bda110903bb3f71c222bf7a34f2412cbb806.intermediate 0d1b2ca30debf9472eeeefe232d3c18ad851edfc.intermediate make: *** [node] Error 2 nvm: install v14.20.0 failed! ```

What did you expect to happen?

node.js version v14.20.0 was successfully downloaded

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

My PATH is:/Library/Frameworks/Python.framework/Versions/3.9/bin:/Users/lvjunpeng/Applications/Gradle/gradle-8.1.1/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin

If you are having installation issues, or getting "N/A", what does curl -I --compressed -v https://nodejs.org/dist/ print out?

```sh * Host nodejs.org:443 was resolved. * IPv6: (none) * IPv4: 104.20.22.46, 104.20.23.46 * Trying 104.20.22.46:443... * Connected to nodejs.org (104.20.22.46) port 443 * ALPN: curl offers h2,http/1.1 * (304) (OUT), TLS handshake, Client hello (1): * CAfile: /etc/ssl/cert.pem * CApath: none * (304) (IN), TLS handshake, Server hello (2): * (304) (IN), TLS handshake, Unknown (8): * (304) (IN), TLS handshake, Certificate (11): * (304) (IN), TLS handshake, CERT verify (15): * (304) (IN), TLS handshake, Finished (20): * (304) (OUT), TLS handshake, Finished (20): * SSL connection using TLSv1.3 / AEAD-CHACHA20-POLY1305-SHA256 / [blank] / UNDEF * ALPN: server accepted h2 * Server certificate: * subject: CN=*.nodejs.org * start date: Feb 28 00:00:00 2024 GMT * expire date: Mar 30 23:59:59 2025 GMT * subjectAltName: host "nodejs.org" matched cert's "nodejs.org" * issuer: C=GB; ST=Greater Manchester; L=Salford; O=Sectigo Limited; CN=Sectigo RSA Domain Validation Secure Server CA * SSL certificate verify ok. * using HTTP/2 * [HTTP/2] [1] OPENED stream for https://nodejs.org/dist/ * [HTTP/2] [1] [:method: HEAD] * [HTTP/2] [1] [:scheme: https] * [HTTP/2] [1] [:authority: nodejs.org] * [HTTP/2] [1] [:path: /dist/] * [HTTP/2] [1] [user-agent: curl/8.6.0] * [HTTP/2] [1] [accept: */*] * [HTTP/2] [1] [accept-encoding: deflate, gzip] > HEAD /dist/ HTTP/2 > Host: nodejs.org > User-Agent: curl/8.6.0 > Accept: */* > Accept-Encoding: deflate, gzip > < HTTP/2 200 HTTP/2 200 < date: Tue, 09 Jul 2024 07:19:09 GMT date: Tue, 09 Jul 2024 07:19:09 GMT < content-type: text/html content-type: text/html < cache-control: public, max-age=3600, s-maxage=14400 cache-control: public, max-age=3600, s-maxage=14400 < last-modified: Tue, 09 Jul 2024 06:15:39 GMT last-modified: Tue, 09 Jul 2024 06:15:39 GMT < cf-cache-status: HIT cf-cache-status: HIT < age: 3262 age: 3262 < vary: Accept-Encoding vary: Accept-Encoding < strict-transport-security: max-age=31536000; includeSubDomains; preload strict-transport-security: max-age=31536000; includeSubDomains; preload < x-content-type-options: nosniff x-content-type-options: nosniff < server: cloudflare server: cloudflare < cf-ray: 8a068b4bed71200a-IAD cf-ray: 8a068b4bed71200a-IAD < content-encoding: gzip content-encoding: gzip < * Connection #0 to host nodejs.org left intact ```
ljharb commented 3 months ago

node < 16 requires a rosetta terminal; see https://github.com/nvm-sh/nvm?tab=readme-ov-file#macos-troubleshooting in the readme.

Live-or commented 3 months ago

Thank you very much for your answer, but I do not want to install Rosetta on my mac, I use the windows version of nvm can solve the problem。

ljharb commented 3 months ago

I’m confused why not, and i don’t understand how you’d use the windows version (i assume you mean nvm-windows, which is an entirely different project) on a Mac?

Live-or commented 3 months ago

Sorry, I didn't make myself clear, I replaced a window computer and re-installed nvm。

ljharb commented 3 months ago

nvm only supports windows on git-bash, cygwin, and WSL2.