节点gypconfiguration总是失败,并出现EXDEV错误

我试图编译下面的MWE,基本上来自官方的Node.js文档 :

#include<v8.h> #include<node.h> using namespace v8; Handle<Value> Method (const Arguments& _args) { HandleScope Scp; return Scp.Close (String::New ("world")); } void Initialize (Handle<Object> _target) { _target->Set ( String.NewSymbol ("hello"), FunctionTemplate::New (Method)->GetFunction () ); } NODE_MODULE ("Hello", Initialize) 

相应的binding.gyp文件如下所示:

 { "targets": [ { "target_name": "hello", "sources": ["hello.cpp"] } ] } 

当我尝试运行node-gyp configure ,出现以下错误:

 $ node-gyp configure info it worked if it ends with ok info downloading http://nodejs.org/dist/v0.6.18/node-v0.6.18.tar.gz ERR! Error: EXDEV, link '/usr/lib/nodejs/node-gyp/legacy/tools/gyp/pylib/gyp/easy_xml.pyc' ERR! not ok $ 

我正在运行Fedora 17的64位版本。下面是uname -a的输出:

 Linux localhost.localdomain 3.5.5-2.fc17.x86_64 #1 SMP Wed Oct 3 13:20:37 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux 

这里是一些更多的系统信息:

 $ rpm -q nodejs nodejs-0.6.18-1.fc17.x86_64 $ rpm -q node-gyp node-gyp-0.4.1-2.fc17.noarch 

在此先感谢您的帮助。

我在我的64位FC16系统中跟踪了一个像这样的问题(和相关的EPERM而不是EXDEV),直到旧版本的node-gyp尝试将文件从系统安装位置(在根文件系统上)硬链接到〜/ .node-gypcaching(在不同的文件系统上)。

在稍后的node-gyp版本中解决了这个问题。

对我来说,解决scheme是从“古老的”节点和node-gyp通过tchol.org RPM库以0.6 RPM的速度分发到当前版本的节点(0.8.12),捆绑自己的npm和node-gyp,没有在这里列出的错误。