松露无法在 MacOS High Sierra 上安装

truffle fails to install on MacOS High Sierra

我正在尝试 运行 在我的 Mac High Sierra (10.13.6) 上执行此命令:

npm 安装-g 松露

但不断出现以下错误:

npm ERR! In file included from /usr/include/string.h:141:
npm ERR! /usr/include/sys/_types/_rsize_t.h:31:9: error: unknown type name '__darwin_size_t'
npm ERR! typedef __darwin_size_t        rsize_t;
npm ERR!         ^
npm ERR! fatal error: too many errors emitted, stopping now [-ferror-limit=]
npm ERR! 20 errors generated.
npm ERR! make: *** [Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/builder.o] Error 1
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:520:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Darwin 17.7.0
npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /Users/satindersingh/node_modules/ganache/node_modules/leveldown
npm ERR! gyp ERR! node -v v17.4.0
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok

如果能得到任何帮助,我将不胜感激。谢谢

以上link确实对我有用。我使用的是 Node V17(奇数),现在已经切换到 V16,现在一切正常。