NPM 安装 sqlite3 错误:node-gyp 重建“没有这样的文件或目录" [英] NPM install sqlite3 error: node-gyp rebuild "No such file or directory"

查看:133
本文介绍了NPM 安装 sqlite3 错误:node-gyp 重建“没有这样的文件或目录"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎无法在 OSX Snow Leopard 中通过 npm 安装 sqlite3,我无法确定原因:

I can't seem to install sqlite3 via npm in OSX Snow Leopard and I haven't been able to determine why:

bravo-de-esmolfo:project knight4$ npm install sqlite3
npm WARN package.json application-name@0.0.1 No repository field.
npm WARN package.json application-name@0.0.1 No readme data.
npm http GET https://registry.npmjs.org/sqlite3
npm http 304 https://registry.npmjs.org/sqlite3
npm http GET https://registry.npmjs.org/tar.gz
npm http 304 https://registry.npmjs.org/tar.gz
npm WARN engine tar.gz@0.1.1: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.10","npm":"1.2.25"})
npm http GET https://registry.npmjs.org/fstream
npm http GET https://registry.npmjs.org/tar
npm http GET https://registry.npmjs.org/commander
npm http 304 https://registry.npmjs.org/tar
npm http 304 https://registry.npmjs.org/fstream
npm http 200 https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/keypress
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/block-stream
npm http 304 https://registry.npmjs.org/keypress
npm http 304 https://registry.npmjs.org/rimraf
npm http 304 https://registry.npmjs.org/graceful-fs
npm http 304 https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/block-stream

> sqlite3@2.1.10 install /Users/knight4/Desktop/project/node_modules/sqlite3
> node-gyp rebuild

Traceback (most recent call last):
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp", line 18, in <module>
    sys.exit(gyp.main(sys.argv[1:]))
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 523, in main
    return gyp_main(args)
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 508, in gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 2105, in GenerateOutput
    part_of_all=qualified_target in needed_targets)
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 769, in Write
    self.Pchify))
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 1154, in WriteSources
    cflags = self.xcode_settings.GetCflags(configname)
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 260, in GetCflags
    sdk_root = self._SdkPath()
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 247, in _SdkPath
    return os.path.join(self._GetSdkBaseDir(),
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 230, in _GetSdkBaseDir
    stderr=subprocess.STDOUT)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1308, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
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/npm/node_modules/node-gyp/lib/configure.js:415:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Darwin 10.8.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/knight4/Desktop/project/node_modules/sqlite3
gyp ERR! node -v v0.10.10
gyp ERR! node-gyp -v v0.9.6
gyp ERR! not ok 
npm ERR! weird error 1
npm ERR! not ok code 0

有什么想法吗?干杯

推荐答案

在 OSX 上,node-gyp 依赖于 python 2.7、make 和 gcc/g++.make、gcc 和 g++ 可以通过安装 XCode 然后使用 XCode 安装命令行工具来安装.

On OSX, node-gyp depends on python 2.7, make, and gcc/g++. make, gcc and g++ can be installed by installing XCode and then using XCode to install the command line tools.

这篇关于NPM 安装 sqlite3 错误:node-gyp 重建“没有这样的文件或目录"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆