gpt4 book ai didi

node.js - 通过 npm 安装 Node iconv 失败

转载 作者:搜寻专家 更新时间:2023-11-01 00:13:36 25 4
gpt4 key购买 nike

我在安装 Node iconv 时遇到问题。

这是当我尝试将它安装到目录 ~/please-work/时发生的情况

please-work >> npm install iconv
npm http GET https://registry.npmjs.org/iconv
npm http 304 https://registry.npmjs.org/iconv

> iconv@1.2.3 install /Users/j/please-work/node_modules/iconv
> node-gyp rebuild

CC(target) Release/obj.target/iconv/deps/libiconv/libcharset/lib/localcharset.o
CC(target) Release/obj.target/iconv/deps/libiconv/lib/iconv.o
In file included from ../deps/libiconv/lib/iconv.c:71:
In file included from ../deps/libiconv/lib/converters.h:133:
../deps/libiconv/lib/utf7.h:162:13: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
if (n < count+base64count+1)
~ ^ ~~~~~~~~~~~~~~~~~~~
../deps/libiconv/lib/utf7.h:331:11: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
if (n < count)
~ ^ ~~~~~

....然后就这样持续了很久

然后以此结束...

620 warnings generated.
CXX(target) Release/obj.target/iconv/binding.o
SOLINK_MODULE(target) Release/iconv.node
File "./gyp-mac-tool", line 159
fd = os.open(lockfile, os.O_RDONLY|os.O_NOCTTY|os.O_CREAT, 0o666)
^
SyntaxError: invalid syntax
make: *** [Release/iconv.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:215:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:91:17)
gyp ERR! stack at Process._handle.onexit (child_process.js:674:10)
gyp ERR! System Darwin 11.4.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/j/please-work/node_modules/iconv
gyp ERR! node -v v0.8.5
gyp ERR! node-gyp -v v0.6.3
gyp ERR! not ok
npm ERR! iconv@1.2.3 install: `node-gyp rebuild`
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the iconv@1.2.3 install script.
npm ERR! This is most likely a problem with the iconv package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls iconv
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 11.4.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "iconv"
npm ERR! cwd /Users/j/please-work
npm ERR! node -v v0.8.5
npm ERR! npm -v 1.1.46
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/j/please-work/npm-debug.log
npm ERR! not ok code 0

任何帮助将不胜感激!谢谢,-J

最佳答案

iconv 的作者指出我可能运行了错误的 python 版本。

一旦我安装了 python 2.7.3 就没问题了。

关于node.js - 通过 npm 安装 Node iconv 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11812842/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com