2012-10-10 37 views
1

我試圖編譯下面MWE,從the official Node.js documentation主要採取:節點GYP配置總是失敗,EXDEV錯誤

#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輸出:提前

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

感謝您的幫助:

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 

下面是一些系統信息。

回答

2

我在我的64位FC16系統中跟蹤了一個像這樣的問題(和一個相關的EPERM而不是EXDEV),直到試圖從系統安裝位置(在根文件系統上)硬連接文件的舊版本node-gyp,到〜/ .node-gyp緩存中(在不同的文件系統上)。

此問題在稍後的node-gyp版本中修復。

對我來說,解決方案是從「古老」節點和node-gyp通過tchol.org RPM回購庫以0.6 RPM的速度分發到當前版本的節點(0.8.12),該節點捆綁了自己的npm和節點-gyp並沒有在這裏列出的錯誤。