3

当我尝试websocket在 NodeJS 中安装模块时出现以下错误。我正在尝试使用 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. 有人可以建议出了什么问题吗?

4

1 回答 1

1

检查是否安装了 python 和 make。我没有在 Ubuntu 上这样做,但在 Windows7 上出现了同样的错误。这篇文章很有帮助。我尝试使用 npm install websocket@1.0.3 并且它有效。

于 2013-05-24T19:59:43.160 回答