2012-06-18 88 views
1

我試圖安裝socket.io使用上beaglebone(Linux的埃)NPM使用node.js v0.6.18安裝socket.io。 WS failes在安裝過程中

/> NPM安裝socket.io

它與舊內核的舊版本節點的工作很大。我現在使用節點v0.6.18。

似乎是在NPM特林安裝這應該與socket.io

我得到同樣的錯誤安裝WS一個問題,如果我嘗試:

npm install ws --ws:verbose 

下面是結果:

[email protected]:~# npm install ws --ws:verbose 
npm http GET https://registry.npmjs.org/ws 
npm http 304 https://registry.npmjs.org/ws 
npm http GET https://registry.npmjs.org/commander 
npm http GET https://registry.npmjs.org/tinycolor 
npm http GET https://registry.npmjs.org/options 
npm http 304 https://registry.npmjs.org/commander 
npm http 304 https://registry.npmjs.org/tinycolor 
npm http 304 https://registry.npmjs.org/options 

> [email protected] install /home/root/node_modules/ws 
> node install.js 

[ws v0.4.18] Attempting to compile blazing fast native extensions. 
info it worked if it ends with ok 
spawn python [ '/home/root/.node-gyp/0.6.18/tools/gyp_addon', 
    'binding.gyp', 
    '-I/home/root/node_modules/ws/build/config.gypi', 
    '-f', 
    'make' ] 
Traceback (most recent call last): 
    File "/home/root/.node-gyp/0.6.18/tools/gyp_addon", line 14, in <module> 
    import gyp 
    File "/home/root/.node-gyp/0.6.18/tools/gyp/pylib/gyp/__init__.py", line 8, in <module> 
    import gyp.input 
    File "/home/root/.node-gyp/0.6.18/tools/gyp/pylib/gyp/input.py", line 5, in <module> 
    from compiler.ast import Const 
ImportError: No module named compiler.ast 
ERR! Error: `gyp_addon` failed with exit code: 1 
    at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:226:16) 
    at ChildProcess.emit (events.js:70:17) 
    at maybeExit (child_process.js:362:16) 
    at Process.onexit (child_process.js:398:5) 
ERR! not ok 
[ws v0.4.18] Native extension compilation failed. 
[ws v0.4.18] On Windows, native extensions require Visual Studio and Python. 
[ws v0.4.18] On Unix, native extensions require Python, make and a C++ compiler. 
[ws v0.4.18] Start npm with --ws:verbose to show compilation output (if any). 
[email protected] ./node_modules/ws 
├── [email protected] 
├── [email protected] 
└── [email protected] 
[email protected]:~# 

我使用的內核3.2.18

[email protected]:~# uname -a 
Linux beaglebone 3.2.18 #1 Thu Jun 14 23:26:20 CEST 2012 armv7l GNU/Linux 
[email protected]:~# 

有什麼想法?

回答

1

我不知道,但我做了一個完整的升級,看看我能否找到任何東西,而我沒有(一切正常)。我不得不重新發布命令兩次(npm up -g)才能完成它,這是我歸因於上游服務器或網絡問題的原因。總之,這裏是我得到了什麼,工作正常(一個基本的Ubuntu 12.04 x64操作系統):

Linux marius-i7 3.2.0-25-generiC#40-Ubuntu SMP Wed May 23 20:30:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux 
node -v: v0.6.19 
[email protected] 
python --version: 2.7.3 

npm install -g ws --ws:verbose輸出:

/usr/local/bin/wscat -> /usr/local/lib/node_modules/ws/bin/wscat 

> [email protected] install /usr/local/lib/node_modules/ws 
> node install.js 

[ws v0.4.18] Attempting to compile blazing fast native extensions. 
make: Entering directory `/usr/local/lib/node_modules/ws/build' 
    CXX(target) Release/obj.target/bufferutil/src/bufferutil.o 
    SOLINK_MODULE(target) Release/obj.target/bufferutil.node 
    SOLINK_MODULE(target) Release/obj.target/bufferutil.node: Finished 
    COPY Release/bufferutil.node 
    CXX(target) Release/obj.target/validation/src/validation.o 
    SOLINK_MODULE(target) Release/obj.target/validation.node 
    SOLINK_MODULE(target) Release/obj.target/validation.node: Finished 
    COPY Release/validation.node 
make: Leaving directory `/usr/local/lib/node_modules/ws/build' 
[ws v0.4.18] Native extension compilation successful! 
[email protected] /usr/local/lib/node_modules/ws/node_modules/tinycolor 

[email protected] /usr/local/lib/node_modules/ws/node_modules/options 

[email protected] /usr/local/lib/node_modules/ws/node_modules/commander 

[email protected] /usr/local/lib/node_modules/ws 

我看你是一個搖臂系統上。對不起,我幫不了你。

2

這不是一個真正的錯誤。本地擴展不是必需的 - 它只是使websocket更快,更快。

+0

你是對的,我試過我的應用程序,它使用socket.io,儘管出現這種錯誤,但它工作正常。 – Seeker

+0

我如何安裝ws?我無法弄清楚爲什麼我得到這個錯誤。 – Seeker

+0

在http://github.com/tootallnate/node-gyp報告問題。我從來沒有見過node-gyp的錯誤。 – einaros