Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 节点gyp重建问题编译器_Node.js_Macos_Node Gyp - Fatal编程技术网

Node.js 节点gyp重建问题编译器

Node.js 节点gyp重建问题编译器,node.js,macos,node-gyp,Node.js,Macos,Node Gyp,我的所有项目似乎都不存在这个问题,尤其是当我运行npmi(node v6.9.4(npm v5.6.0)时,有一个项目出现了这个问题您基本上需要安装libtool才能使其工作。这与我使用bcrypt时遇到的问题相同。如果这似乎不起作用,您应该看看 另外,请检查安装了哪一版本的python。支持的版本是2.7。根据文档,最新的3.x还不受支持。这将讨论有关gyp的更多详细信息。这也会有所帮助。我不完全确定解决方案是什么 我安装了xcode 8.2.1(从9.1降下来)。我以前试过这个,但是 起初,

我的所有项目似乎都不存在这个问题,尤其是当我运行
npmi
(node v6.9.4(npm v5.6.0)时,有一个项目出现了这个问题您基本上需要安装
libtool
才能使其工作。这与我使用
bcrypt
时遇到的问题相同。如果这似乎不起作用,您应该看看


另外,请检查安装了哪一版本的python。支持的版本是2.7。根据文档,最新的3.x还不受支持。这将讨论有关gyp的更多详细信息。这也会有所帮助。

我不完全确定解决方案是什么

  • 我安装了xcode 8.2.1(从9.1降下来)。我以前试过这个,但是 起初,这不起作用
  • 然后我手动安装了commandlinetools(不是通过
    xcode选择--install
    )(
    Library/Developer/CommandLineTools
    在此安装之前或之后不存在)-
    xcode选择-p
    将其路径从指向xcode更改为commandlinetools 虽然dir不存在
  • 然后我再次安装了Xcode8.2.1,xcode会自动选择其路径 在不重置的情况下更改(xcode选择--重置)

  • 在此之后,我的问题得到了解决。

    libtool已经安装。python的默认值设置为2.7.10。我将查看node js研讨会,谢谢。
    xcode select
    安装node gyp所需的许多工具,如C编译器、python库和各种杂项命令行工具。
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__threading_support:25:11: fatal error: 
              'pthread.h' file not found
        # include <pthread.h>
    
    12788 verbose stack Error: farmhash@1.2.1 install: `node-gyp rebuild`
    12788 verbose stack Exit status 1
    12788 verbose stack     at EventEmitter.<anonymous> (/Users/tom.firth/.nvm/versions/node/v6.9.4/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16)
    12788 verbose stack     at emitTwo (events.js:106:13)
    12788 verbose stack     at EventEmitter.emit (events.js:191:7)
    12788 verbose stack     at ChildProcess.<anonymous> (/Users/tom.firth/.nvm/versions/node/v6.9.4/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
    12788 verbose stack     at emitTwo (events.js:106:13)
    12788 verbose stack     at ChildProcess.emit (events.js:191:7)
    12788 verbose stack     at maybeClose (internal/child_process.js:877:16)
    12788 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
    12789 verbose pkgid farmhash@1.2.1
    12790 verbose cwd /Users/tom.firth/Sites/the-works
    12791 verbose Darwin 16.7.0
    12792 verbose argv "/Users/tom.firth/.nvm/versions/node/v6.9.4/bin/node" "/Users/tom.firth/.nvm/versions/node/v6.9.4/bin/npm" "i"
    12793 verbose node v6.9.4
    12794 verbose npm  v5.6.0
    12795 error code ELIFECYCLE
    12796 error errno 1
    12797 error farmhash@1.2.1 install: `node-gyp rebuild`
    12797 error Exit status 1
    12798 error Failed at the farmhash@1.2.1 install script.
    12798 error This is probably not a problem with npm. There is likely additional logging output above.
    12799 verbose exit [ 1, true ]
    
    Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
    Apple LLVM version 9.0.0 (clang-900.0.38)
    Target: x86_64-apple-darwin16.7.0
    Thread model: posix
    InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin