Node.js:无法安装iconv模块

Node.js:无法安装iconv模块,node.js,installation,iconv,Node.js,Installation,Iconv,我尝试安装iconv模块,但它始终停留在: ^Cyippeeyippee@mini: server$ 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/yippeeyippee/Desktop/nodejs/tinman/server/node_modules/i

我尝试安装iconv模块,但它始终停留在:

^Cyippeeyippee@mini: server$ 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/yippeeyippee/Desktop/nodejs/tinman/server/node_modules/iconv
> node-gyp rebuild

gyp http GET http://nodejs.org/dist/v0.8.7/node-v0.8.7.tar.gz
gyp http 200 http://nodejs.org/dist/v0.8.7/node-v0.8.7.tar.gz
我不知道发生了什么,成功还是失败,我该如何解决这个问题

更新:

在等待了很长时间之后,我得到了如下失败信息:

xcode-select: Error: No Xcode is selected. Use xcode-select -switch /Applications/Xcode.app to select /Applications/Xcode.app, or see the xcode-select manpage (man xcode-select) for further information.

Traceback (most recent call last):
  File "/Users/yippeeyippee/.node-gyp/0.8.7/tools/gyp/gyp", line 18, in <module>
    sys.exit(gyp.main(sys.argv[1:]))
  File "/Users/yippeeyippee/.node-gyp/0.8.7/tools/gyp/pylib/gyp/__init__.py", line 480, in main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "/Users/yippeeyippee/.node-gyp/0.8.7/tools/gyp/pylib/gyp/generator/make.py", line 2082, in GenerateOutput
    part_of_all=qualified_target in needed_targets)
  File "/Users/yippeeyippee/.node-gyp/0.8.7/tools/gyp/pylib/gyp/generator/make.py", line 764, in Write
    self.Pchify))
  File "/Users/yippeeyippee/.node-gyp/0.8.7/tools/gyp/pylib/gyp/generator/make.py", line 1137, in WriteSources
    cflags = self.xcode_settings.GetCflags(configname)
  File "/Users/yippeeyippee/.node-gyp/0.8.7/tools/gyp/pylib/gyp/xcode_emulation.py", line 259, in GetCflags
    sdk_root = self._SdkPath()
  File "/Users/yippeeyippee/.node-gyp/0.8.7/tools/gyp/pylib/gyp/xcode_emulation.py", line 248, in _SdkPath
    return os.path.join(self._GetSdkBaseDir(), '%s.sdk' % sdk_root)
  File "/Users/yippeeyippee/.node-gyp/0.8.7/tools/gyp/pylib/gyp/xcode_emulation.py", line 234, in _GetSdkBaseDir
    raise Exception('Error %d running xcode-select' % job.returncode)
Exception: Error 1 running xcode-select
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/node-gyp/lib/configure.js:346:16)
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/bin/node-gyp" "rebuild"
gyp ERR! cwd /Users/yippeeyippee/Desktop/nodejs/tinman/server/node_modules/iconv
gyp ERR! node -v v0.8.7
gyp ERR! node-gyp -v v0.6.8
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/yippeeyippee/Desktop/nodejs/tinman/server
npm ERR! node -v v0.8.7
npm ERR! npm -v 1.1.49
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/yippeeyippee/Desktop/nodejs/tinman/server/npm-debug.log
npm ERR! not ok code 0

在此步骤中,node gyp安装程序下载node.js源代码。这可能需要很长时间,具体取决于您的连接速度。例如:我在中国连接速度非常慢的服务器上等待了大约20-25分钟。

在这一步,node gyp安装程序下载node.js源代码。这可能需要很长时间,具体取决于您的连接速度。例如:我在中国连接速度非常慢的服务器上等待了大约20-25分钟。

命令行工具仅限Xcode方法 下载并安装Mac OS X Developer 运行sudoxcode选择-switch/usr/bin。有关详细信息,请参阅 请重试npm安装iconv 未经我测试的Xcode版本 下载并安装完整的 请再次尝试npm安装iconv。如果成功了,你就完了。 如果出现相同错误,请尝试sudo xcode select-switch/Applications/xcode.app,然后重试npm安装iconv 命令行工具没有Xcode方法 下载并安装Mac OS X Developer 运行sudoxcode选择-switch/usr/bin。有关详细信息,请参阅 请重试npm安装iconv 未经我测试的Xcode版本 下载并安装完整的 请再次尝试npm安装iconv。如果成功了,你就完了。 如果出现相同错误,请尝试sudo xcode select-switch/Applications/xcode.app,然后重试npm安装iconv
您是否正确安装了node gyp及其依赖项@JohnnyHK:我已经安装了它v0.6.8您是否正确安装了node gyp及其依赖项@JohnnyHK:我已经安装了v0.6.8版,可能不是问题,我已经更新了失败的信息;你在使用Mac操作系统吗?试着在这里看到同样的问题。执行sudo xcode select-switch/Applications/xcode.app可能会对您有所帮助。但我没有Mac OS来检查这个。也许这不是问题,我已经更新了失败的信息;你在使用Mac操作系统吗?试着在这里看到同样的问题。执行sudo xcode select-switch/Applications/xcode.app可能会对您有所帮助。但我没有Mac OS来检查这一点。我有一个错误:gyp失败,退出代码为1,运行sudo xcode select-switch/usr/bin完成了任务!Thanx!!为我工作。谢谢谢谢这个解决方案似乎修复了npm pg包的节点gyp错误以及postgresI的错误:gyp失败,退出代码为1,运行sudo xcode select-switch/usr/bin完成了任务!Thanx!!为我工作。谢谢谢谢此解决方案似乎修复了npm pg包以及postgres的节点gyp错误