节点/ npm的旧版本链接到-lstdc ++,而macOS catalina上不支持它

问题描述 投票:1回答:1

在macOS catalina上使用旧版本的节点(5.x),在软件包上运行npm install会尝试安装node-gyp,这将导致错误。

 fatal error: 'algorithm' file not found

有关SO和github的其他信息,很明显,您可以通过将macOS构建目标设置为10.9或更高版本来克服此问题:

$ export CXXFLAGS="-mmacosx-version-min=10.9"; npm install

这样做会导致新的错误:

clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
ld: library not found for -lstdc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)

表示在此版本的clang中不再尝试使用标准C ++库。有没有一种方法可以覆盖它,以便它尝试链接到libc ++而不是libstdc ++? (无法更新到新版本的节点等)

node.js npm
1个回答
0
投票

这应该在节点版本> = 7.0中解决。

© www.soinside.com 2019 - 2024. All rights reserved.