libstdc++ 已弃用;在 Catalina 上使用 npm 安装 Babel 时移动到 libc++

libstdc++ is deprecated; move to libc++ when installing Babel using npm on Catalina

我的错误输出如下所示:

> node-gyp rebuild

  SOLINK_MODULE(target) Release/.node
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)
make: *** [Release/.node] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:219:12)
gyp ERR! System Darwin 19.4.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/simonhurst/PycharmProjects/supervalet/node_modules/fsevents
gyp ERR! node -v v6.17.1
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok 

当运行

npm i -D @babel/core babel-loader @babel/preset-env @babel/preset-react babel-plugin-transform-class-properties

现在我可以看到问题出在这里了:

library not found for -lstdc++

但是对如何解决它一无所知。

一直在搜索网络和 Whosebug - 搞乱卸载 Xcode 重新安装 exode 看起来像 hombrew...等等,但到目前为止还没有任何乐趣。

我是 Python 开发者,所以节点肯定不是我的专长。如果有人可以阐明如何解决这个问题,那就太好了。我不敢相信我是唯一拥有它的人。

谢谢

哇,在阅读了 GitHub 上的许多帖子和许多问题之后...我的解决方案无法确保我已安装 Xcode,并且安装了相应的命令行工具并使确定我接受了 Apple 许可协议。这只是更新我正在使用的节点版本的问题。在我的例子中,我使用的是 6.x 版本,这是预装在我的全新 mac 上的版本。恼人的。访问 https://nodejs.org/en/ 升级您的节点版本。在撰写本文时,我升级到的版本是 12.16.1 - 如果这对未来 reader 这个问题的回答会话有帮助:)

真的觉得错误消息在这里可能更有用,但嘿,有时候事情就是这样。