2013-10-24 109 views
3

我想安裝topojson OSX小牛,我得到一個致命錯誤:fatal error: 'sys/types.h' file not found。我在下面包括導致終端出現錯誤以及接下來的一切。topojson命令行安裝拋出致命錯誤

我剛剛爲此安裝了node.js--所以我不確定問題與哪個軟件包有關。

... 
npm http 304 https://registry.npmjs.org/boom 
npm http 304 https://registry.npmjs.org/hoek 
npm http 304 https://registry.npmjs.org/delayed-stream/0.0.5 
    CXX(target) Release/obj.target/contextify/src/contextify.o 
In file included from ../src/contextify.cc:1: 
In file included from /Users/anekola/.node-gyp/0.10.21/src/node.h:61: 
/Users/anekola/.node-gyp/0.10.21/deps/uv/include/uv.h:59:10: fatal error: 'sys/types.h' file not found 
#include <sys/types.h> /* size_t */ 
     ^
1 error generated. 
make: *** [Release/obj.target/contextify/src/contextify.o] Error 1 
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2 
gyp ERR! stack  at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23) 
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 13.0.0 
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" 
gyp ERR! cwd /usr/local/lib/node_modules/topojson/node_modules/d3/node_modules/jsdom/node_modules/contextify 
gyp ERR! node -v v0.10.21 
gyp ERR! node-gyp -v v0.10.10 
gyp ERR! not ok 
npm ERR! weird error 1 
npm ERR! not ok code 0 

我確實使用sudo:sudo npm install -g topojson。我絕不是命令行的專家。

+0

您是否安裝了xcode並將其升級到最新版本,並且您是否安裝了用於xcode的命令行工具? –

+0

xcode可能是問題。我的辦公室在這裏有一些對小牛隊反應不佳的軟件,所以事情搞砸了。現在更新 - 當我有結果時會更新。 –

+0

你是否設法解決這個問題?我收到了同樣的錯誤 – Stefan

回答

1

傑夫是對的 - 謝謝傑夫 - 似乎我只是需要確保我的xcode已更新。事實上,我發現在更新到Maverick後我需要重新安裝xcode。我沒有想到。

此處下載鏈接:https://developer.apple.com/xcode/

對不起,tak3r - 以爲我這個上週發佈!