我正在尝试编译以下MWE,主要来自the official Node.js documentation:
#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
$
我正在运行64位版本的Fedora 17.以下是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
提前感谢您的帮助。
答案 0 :(得分:2)
我在我的64位FC16系统上跟踪了这样的问题(以及相关的EPERM而不是EXDEV),直到旧版本的node-gyp尝试将文件从系统安装位置(在根文件系统上)硬链接到〜/ .node-gyp缓存(在不同的文件系统上)。
此问题已在稍后的node-gyp版本中修复。
对我来说,解决方案是从“古老”节点和node-gyp通过tchol.org RPM repo以0.6 RPM的速度分发到当前版本的节点(0.8.12),该节点捆绑了自己的npm和节点 - gyp并没有此处列出的错误。