1

ビーグルボーン(Linuxオングストローム)にnpmを使用してsocket.ioをインストールしようとしています

/> npm install socket.io

古いカーネルの古いバージョンのノードでうまく機能しました。現在、ノードv0.6.18を使用しています。

npm tringがsocket.ioでインストールすることになっているwsをインストールするときに、問題があるようです。

試してみると同じエラーが発生します:

npm install ws --ws:verbose

結果は次のとおりです。

root@beaglebone:~# 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

> ws@0.4.18 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).
ws@0.4.18 ./node_modules/ws
├── tinycolor@0.0.1
├── options@0.0.3
└── commander@0.5.2
root@beaglebone:~#

カーネル3.2.18を使用しています

root@beaglebone:~# uname -a
Linux beaglebone 3.2.18 #1 Thu Jun 14 23:26:20 CEST 2012 armv7l GNU/Linux
root@beaglebone:~# 

何か案が?

4

2 に答える 2

1

それは実際にはエラーではありません。ネイティブの拡張機能は必要ありません。たまたま WebSocket がはるかに高速になるだけです。

于 2012-06-19T16:14:45.047 に答える
1

I have no idea, but I did a complete upgrade to see if I could find anything, and I did not (everything worked). I had to reissue a command twice (npm up -g) to get it to complete, something I attribute to an upstream server or network problem. Anyway, here's what I've got which works fine (a basic Ubuntu 12.04 x64 system):

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
ws@0.4.18
python --version: 2.7.3

npm install -g ws --ws:verbose outputs:

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

> ws@0.4.18 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!
tinycolor@0.0.1 /usr/local/lib/node_modules/ws/node_modules/tinycolor

options@0.0.3 /usr/local/lib/node_modules/ws/node_modules/options

commander@0.5.2 /usr/local/lib/node_modules/ws/node_modules/commander

ws@0.4.18 /usr/local/lib/node_modules/ws

I see you're on an arm system. Sorry I can't help you with that.

于 2012-06-18T19:24:41.457 に答える