Fel*_*ets 7 python macos node.js npm node-gyp
上周我将 macOS 更新到 12.3 后,在运行 make for hunspell 时,我开始在 node-gyp 上遇到错误,hunspell 是 npm 库拼写检查器的依赖项。
没有与环境或版本相关的其他变化,编译仍然适用于我的同事:
> spellchecker@3.7.1 install /Users/myuser/projects/project/packages/data/node_modules/spellchecker
> node-gyp rebuild
CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/affentry.o
CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/affixmgr.o
CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/csutil.o
CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/dictmgr.o
CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/filemgr.o
CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/hashmgr.o
CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/hunspell.o
CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/hunzip.o
CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/phonet.o
CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/replist.o
CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/suggestmgr.o
CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/parsers/textparser.o
LIBTOOL-STATIC Release/hunspell.a
lerna ERR! npm install stderr:
../vendor/hunspell/src/hunspell/affentry.cxx:544:47: warning: while loop has empty body [-Wempty-body]
while (p && *p != ']' && (p = nextchar(p)));
^
../vendor/hunspell/src/hunspell/affentry.cxx:544:47: note: put the semicolon on a separate line to silence this warning
1 warning generated.
In file included from ../vendor/hunspell/src/hunspell/affixmgr.cxx:12:
../vendor/hunspell/src/hunspell/affentry.hxx:30:105: warning: implicit conversion of NULL constant to 'unsigned short' [-Wnull-conversion]
struct hentry * check_twosfx(const char * word, int len, char in_compound, const FLAG needflag = NULL);
~ ^~~~
0
../vendor/hunspell/src/hunspell/affentry.hxx:93:114: warning: implicit conversion of NULL constant to 'unsigned short' [-Wnull-conversion]
struct hentry * check_twosfx(const char * word, int len, int optflags, PfxEntry* ppfx, const FLAG needflag = NULL);
~ ^~~~
0
../vendor/hunspell/src/hunspell/affixmgr.cxx:3654:65: warning: 'strncmp' call operates on objects of type 'const char' while the size is based on a different type 'const char *' [-Wsizeof-pointer-memaccess]
if (strncmp(piece, keyword, sizeof(keyword)) != 0) {
~~~~~~~ ^~~~~~~
../vendor/hunspell/src/hunspell/affixmgr.cxx:3654:65: note: did you mean to provide an explicit length?
if (strncmp(piece, keyword, sizeof(keyword)) != 0) {
^~~~~~~
3 warnings generated.
In file included from ../vendor/hunspell/src/hunspell/hashmgr.cxx:9:
../vendor/hunspell/src/hunspell/hashmgr.hxx:17:21: warning: private field 'userword' is not used [-Wunused-private-field]
int userword;
^
1 warning generated
env: python: No such file or directory
make: *** [Release/hunspell.a] Error 127
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/myuser/.volta/tools/image/npm/6.14.16/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:400:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12)
gyp ERR! System Darwin 21.4.0
gyp ERR! command "/Users/myuser/.volta/tools/image/node/14.19.1/bin/node" "/Users/myuser/.volta/tools/image/npm/6.14.16/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/myuser/projects/project/packages/data/node_modules/spellchecker
gyp ERR! node -v v14.19.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN @typescript-eslint/experimental-utils@1.13.0 requires a peer of eslint@* but none is installed. You must install peer dependencies yourself.
npm WARN @typescript-eslint/parser@1.13.0 requires a peer of eslint@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! spellchecker@3.7.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the spellchecker@3.7.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/myuser/.npm/_logs/2022-03-29T14_24_01_048Z-debug.log
Run Code Online (Sandbox Code Playgroud)
系统概要:
Fel*_*ets 19
问题与日志中的这一行有关:
env: python: No such file or directory
Run Code Online (Sandbox Code Playgroud)
Apple 确实删除了 macOS 附带的默认 Python 安装 (Python 2.7)(macOS 12.3 发行说明)。
修复方法非常简单,只需安装 Python 并将路径更改为默认路径即可。本教程涵盖了它:https://dev.to/malwarebo/how-to-set-python3-as-a-default-python-version-on-mac-4jjf
| 归档时间: |
|
| 查看次数: |
10299 次 |
| 最近记录: |