nvm 安装node版本报错clang: error: no such file or directory: 'CXX=c++'
使用nvm 管理node多版本时,出现无法安装情况解决方案
首先附上官方参考文章地址 原文地址:https://github.com/nvm-sh/nvm/issues/2350 之前我一直用的是MBP PRO 2015 15‘’,最近公司给配了 Mac Mini M1, 需要把项目挪到新电脑上,本着来的折腾, 直接安装同版本的node和vue等时出现了如下错误:。
- 执行命令:
nvm install v15.2.1
- 出现错误
clang: error: no such file or directory: ‘CXX=c++’ - 日志如下:
Downloading and installing node v15.2.1...
Local cache found: $NVM_DIR/.cache/bin/node-v15.2.1-darwin-arm64/node-v15.2.1-darwin-arm64.tar.gz
Computing checksum with shasum -a 256
Provided checksum to compare to is empty.
Checksum check failed!
Removing the broken local cache...
Downloading https://nodejs.org/dist/v15.2.1/node-v15.2.1-darwin-arm64.tar.gz...
##O#- #
Computing checksum with shasum -a 256
Provided checksum to compare to is empty.
tar: Error opening archive: Unrecognized archive format
Binary download failed, trying source.
Local cache found: $NVM_DIR/.cache/src/node-v15.2.1/node-v15.2.1.tar.gz
Checksums match! Using existing downloaded archive $NVM_DIR/.cache/src/node-v15.2.1/node-v15.2.1.tar.gz
Node.js configure: Found Python 2.7.16...
INFO: configure completed successfully
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C out BUILDTYPE=Release V=0
LD_LIBRARY_PATH=/Users/andy/.nvm/.cache/src/node-
v15.2.1/files/out/Release/lib.host:/Users/andy/.nvm/.cache/src/node
v15.2.1/files/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../.; mkdir -p
/Users/andy/.nvm/.cache/src/node-v15.2.1/files/out/Release/obj/gen; dtrace -h -xnolibs -s src/node_provider.d -o "/Users/andy/.nvm/.cache/src/node-v15.2.1/files/out/Release/obj/gen/node_provider.h"
LD_LIBRARY_PATH=/Users/andy/.nvm/.cache/src/node-
v15.2.1/files/out/Release/lib.host:/Users/andy/.nvm/.cache/src/node
v15.2.1/files/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../.; mkdir -p
/Users/andy/.nvm/.cache/src/node-v15.2.1/files/out/Release; tools/specialize_node_d.py
"/Users/andy/.nvm/.cache/src/node-v15.2.1/files/out/Release/node.d" src/node.d mac arm64
touch /Users/andy/.nvm/.cache/src/node
v15.2.1/files/out/Release/obj.target/tools/icu/icu_implementation.stamp
touch /Users/andy/.nvm/.cache/src/node-v15.2.1/files/out/Release/obj.target/tools/icu/icu_uconfig.stamp
touch /Users/andy/.nvm/.cache/src/node-v15.2.1/files/out/Release/obj.target/tools/icu/icu_uconfig_target.stamp
touch /Users/andy/.nvm/.cache/src/node-v15.2.1/files/out/Release/obj.host/tools/icu/icu_implementation.stamp
touch /Users/andy/.nvm/.cache/src/node-v15.2.1/files/out/Release/obj.host/tools/icu/icu_uconfig.stamp
cc CXX=c++ -o /Users/andy/.nvm/.cache/src/node
v15.2.1/files/out/Release/obj.target/openssl/deps/openssl/openssl/ssl/bio_ssl.o
../deps/openssl/openssl/ssl/bio_ssl.c '-DV8_DEPRECATION_WARNINGS'
DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-
DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DOPENSSL_NO_HW' '-DOPENSSL_NO_QUIC=1'-
'-DNDEBUG' '-DL_ENDIAN' '-DOPENSSL_PIC' '-DOPENSSL_CPUID_OBJ' '-DOPENSSL_BN_ASM_MONT' '-
DSHA1_ASM' '-DSHA256_ASM' '-DSHA512_ASM' '-DKECCAK1600_ASM' '-DVPAES_ASM' '-
DECP_NISTZ256_ASM' '-DPOLY1305_ASM' '-DOPENSSLDIR="/System/Library/OpenSSL/"' '-
DENGINESDIR="/dev/null"' -I../deps/openssl/openssl -I../deps/openssl/openssl/include
I../deps/openssl/openssl/crypto -I../deps/openssl/openssl/crypto/include -I../deps/openssl/openssl/crypto/modes
-I../deps/openssl/openssl/crypto/ec/curve448 -I../deps/openssl/openssl/crypto/ec/curve448/arch_32 -
I../deps/openssl/config -I../deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2 -
I../deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2/include -I../deps/openssl/config/archs/darwin64-
arm64-cc/asm_avx2/crypto -I../deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2/crypto/include/internal
-O3 -gdwarf-2 -mmacosx-version-min=10.13 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -
Wno-missing-field-initializers -fno-strict-aliasing -MMD -MF /Users/andy/.nvm/.cache/src/node-
v15.2.1/files/out/Release/.deps
v15.2.1/files/out/Release/obj.target/openssl/deps/openssl/openssl/ssl/bio_ssl.o.d.raw -c
cc CXX=c++ -o /Users/andy/.nvm/.cache/src/node-
v15.2.1/files/out/Release/obj.target/openssl/deps/openssl/openssl/ssl/d1_lib.o
../deps/openssl/openssl/ssl/d1_lib.c '-DV8_DEPRECATION_WARNINGS' '-
DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-
DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DOPENSSL_NO_HW' '-DOPENSSL_NO_QUIC=1'
'-DNDEBUG' '-DL_ENDIAN' '-DOPENSSL_PIC' '-DOPENSSL_CPUID_OBJ' '-DOPENSSL_BN_ASM_MONT' '-
DSHA1_ASM' '-DSHA256_ASM' '-DSHA512_ASM' '-DKECCAK1600_ASM' '-DVPAES_ASM' '-
DECP_NISTZ256_ASM' '-DPOLY1305_ASM' '-DOPENSSLDIR="/System/Library/OpenSSL/"' '-
DENGINESDIR="/dev/null"' -I../deps/openssl/openssl -I../deps/openssl/openssl/include -
I../deps/openssl/openssl/crypto -I../deps/openssl/openssl/crypto/include -I../deps/openssl/openssl/crypto/modes
-I../deps/openssl/openssl/crypto/ec/curve448 -I../deps/openssl/openssl/crypto/ec/curve448/arch_32 -
I../deps/openssl/config -I../deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2 -
I../deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2/include -I../deps/openssl/config/archs/darwin64-
arm64-cc/asm_avx2/crypto -I../deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2/crypto/include/internal
-O3 -gdwarf-2 -mmacosx-version-min=10.13 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -
Wno-missing-field-initializers -fno-strict-aliasing -MMD -MF /Users/andy/.nvm/.cache/src/node-
v15.2.1/files/out/Release/.deps
v15.2.1/files/out/Release/obj.target/openssl/deps/openssl/openssl/ssl/d1_lib.o.d.raw -c
cc CXX=c++ -o /Users/andy/.nvm/.cache/src/node-
v15.2.1/files/out/Release/obj.target/openssl/deps/openssl/openssl/ssl/d1_msg.o
../deps/openssl/openssl/ssl/d1_msg.c '-DV8_DEPRECATION_WARNINGS' '-
DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-
DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DOPENSSL_NO_HW' '-DOPENSSL_NO_QUIC=1'
'-DNDEBUG' '-DL_ENDIAN' '-DOPENSSL_PIC' '-DOPENSSL_CPUID_OBJ' '-DOPENSSL_BN_ASM_MONT' '-
DSHA1_ASM' '-DSHA256_ASM' '-DSHA512_ASM' '-DKECCAK1600_ASM' '-DVPAES_ASM' '-
DECP_NISTZ256_ASM' '-DPOLY1305_ASM' '-DOPENSSLDIR="/System/Library/OpenSSL/"' '-
DENGINESDIR="/dev/null"' -I../deps/openssl/openssl -I../deps/openssl/openssl/include -
I../deps/openssl/openssl/crypto -I../deps/openssl/openssl/crypto/include -I../deps/openssl/openssl/crypto/modes
-I../deps/openssl/openssl/crypto/ec/curve448 -I../deps/openssl/openssl/crypto/ec/curve448/arch_32 -
I../deps/openssl/config -I../deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2 -
I../deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2/include -I../deps/openssl/config/archs/darwin64-
arm64-cc/asm_avx2/crypto -I../deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2/crypto/include/internal
-O3 -gdwarf-2 -mmacosx-version-min=10.13 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -
Wno-missing-field-initializers -fno-strict-aliasing -MMD -MF /Users/andy/.nvm/.cache/src/node-
v15.2.1/files/out/Release/.deps
v15.2.1/files/out/Release/obj.target/openssl/deps/openssl/openssl/ssl/d1_msg.o.d.raw -c
cc CXX=c++ -o /Users/andy/.nvm/.cache/src/node-
v15.2.1/files/out/Release/obj.target/openssl/deps/openssl/openssl/ssl/d1_srtp.o
../deps/openssl/openssl/ssl/d1_srtp.c '-DV8_DEPRECATION_WARNINGS' '-
DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-
DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DOPENSSL_NO_HW' '-DOPENSSL_NO_QUIC=1'
'-DNDEBUG' '-DL_ENDIAN' '-DOPENSSL_PIC' '-DOPENSSL_CPUID_OBJ' '-DOPENSSL_BN_ASM_MONT' '-
DSHA1_ASM' '-DSHA256_ASM' '-DSHA512_ASM' '-DKECCAK1600_ASM' '-DVPAES_ASM' '-
DECP_NISTZ256_ASM' '-DPOLY1305_ASM' '-DOPENSSLDIR="/System/Library/OpenSSL/"' '-
DENGINESDIR="/dev/null"' -I../deps/openssl/openssl -I../deps/openssl/openssl/include -
I../deps/openssl/openssl/crypto -I../deps/openssl/openssl/crypto/include -I../deps/openssl/openssl/crypto/modes -
I../deps/openssl/openssl/crypto/ec/curve448 -I../deps/openssl/openssl/crypto/ec/curve448/arch_32 -
I../deps/openssl/config -I../deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2 -
I../deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2/include -I../deps/openssl/config/archs/darwin64-
arm64-cc/asm_avx2/crypto -I../deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2/crypto/include/internal -
O3 -gdwarf-2 -mmacosx-version-min=10.13 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -Wno-
missing-field-initializers -fno-strict-aliasing -MMD -MF /Users/andy/.nvm/.cache/src/node-
v15.2.1/files/out/Release/.deps
v15.2.1/files/out/Release/obj.target/openssl/deps/openssl/openssl/ssl/d1_srtp.o.d.raw -c
cc CXX=c++ -o /Users/andy/.nvm/.cache/src/node- v15.2.1/files/out/Release/obj.target/openssl/deps/openssl/openssl/ssl/methods.o ../deps/openssl/openssl/ssl/methods.c '-DV8_DEPRECATION_WARNINGS' '- DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DOPENSSL_NO_HW' '-DOPENSSL_NO_QUIC=1' '-DNDEBUG' '-DL_ENDIAN' '-DOPENSSL_PIC' '-DOPENSSL_CPUID_OBJ' '-DOPENSSL_BN_ASM_MONT' '-DSHA1_ASM' '-DSHA256_ASM' '-DSHA512_ASM' '-DKECCAK1600_ASM' '-DVPAES_ASM' '-DECP_NISTZ256_ASM' '-DPOLY1305_ASM' '-DOPENSSLDIR="/System/Library/OpenSSL/"' '-DENGINESDIR="/dev/null"' -I../deps/openssl/openssl -I../deps/openssl/openssl/include -I../deps/openssl/openssl/crypto -I../deps/openssl/openssl/crypto/include -I../deps/openssl/openssl/crypto/modes -I../deps/openssl/openssl/crypto/ec/curve448 -I../deps/openssl/openssl/crypto/ec/curve448/arch_32 -I../deps/openssl/config -I../deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2 -I../deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2/include -I../deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2/crypto -I../deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2/crypto/include/internal -O3 -gdwarf-2 -mmacosx-version-min=10.13 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -Wno-missing-field-initializers -fno-strict-aliasing -MMD -MF /Users/andy/.nvm/.cache/src/node-v15.2.1/files/out/Release/.deps
clang: error: no such file or directory: 'CXX=c++'
clang: error: no such file or directory: 'CXX=c++'
clang: error: no such file or directory: 'CXX=c++'
make[1]: *** [/Users/andy/.nvm/.cache/src/node-v15.2.1/files/out/Release/obj.target/openssl/deps/openssl/openssl/ssl/d1_msg.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [/Users/andy/.nvm/.cache/src/node-v15.2.1/files/out/Release/obj.target/openssl/deps/openssl/openssl/ssl/bio_ssl.o] Error 1
make[1]: *** [/Users/andy/.nvm/.cache/src/node-v15.2.1/files/out/Release/obj.target/openssl/deps/openssl/openssl/ssl/d1_lib.o] Error 1
clang: error: no such file or directory: 'CXX=c++'
clang: error: no such file or directory: 'CXX=c++'
make[1]: *** [/Users/andy/.nvm/.cache/src/node-v15.2.1/files/out/Release/obj.target/openssl/deps/openssl/openssl/ssl/methods.o] Error 1
make[1]: *** [/Users/andy/.nvm/.cache/src/node-v15.2.1/files/out/Release/obj.target/openssl/deps/openssl/openssl/ssl/d1_srtp.o] Error 1
make: *** [node] Error 2
nvm: install v15.2.1 failed!
- 原来在 inter 平台是什么没有问题的, 现在在ARM平台(M1)上出现了问题, 具体什么原因没有深究,主要记录解决问题方案,有兴趣的大佬自行探索,下面贴一下原文地址:
原文地址:https://github.com/nvm-sh/nvm/issues/2350
解决方案
- 第一步:打开 访达 >>> 左侧点击应用程序 >>> 找到你的终端(我是自带的出了问题)
- 第二步:鼠标放在“终端” app上 右键 >>> 显示简介
- 勾选下图中选项, 关闭所有终端重新打开后就正常了
根据参考文档说法,好像是安装 v14以下会出问题,如下: 原文地址:https://github.com/nvm-sh/nvm/issues/2350
此处做记录,防止那天自己找不到
|