尝试通过npm在NodeJS中安装websocket模块时出错

时间:2013-01-19 17:13:59

标签: node.js websocket npm

当我尝试在NodeJS中安装websocket模块时出现以下错误。我正在尝试使用Ubuntu 12.04机器。

ubuntu@domU-12-31-39-14-1A-A1:/var/www$ npm install websocket
npm http GET https://registry.npmjs.org/websocket
npm http 304 https://registry.npmjs.org/websocket

> websocket@1.0.8 install /var/www/node_modules/websocket
> node install.js

[websocket v1.0.8] Attempting to compile native extensions.
[websocket v1.0.8]
Native code compile failed!!
Please note that this module DOES NOT REQUIRE the native components
and will still work without them, though not quite as efficiently.

On Windows, native extensions require Visual Studio and Python.
On Unix, native extensions require Python, make and a C++ compiler.
Start npm with --websocket:verbose to show compilation output (if any).
websocket@1.0.8 node_modules/websocket

我用来安装websocket模块的命令是npm install websocket。有人可以告知出了什么问题吗?

1 个答案:

答案 0 :(得分:1)

检查是否安装了python和make。 我没有在Ubuntu上做过这个,但是在Windows7上出现了同样的错误。这个post很有帮助。我尝试使用npm install websocket@1.0.3并且工作正常。