npm install socket.io安装socket.io出错
发布于 3年前 作者 pestd 2099 次浏览

npm install socket.io 出错: [ws v0.4.18] Attempting to compile blazing fast native extensions.

[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).

3 回复

这是全部的错误提示吗? 感觉像缺少开发环境…

[root@localhost gyp]# npm install socket.io

npm http GET https://registry.npmjs.org/socket.io npm http 304 https://registry.npmjs.org/socket.io npm http GET https://registry.npmjs.org/policyfile/0.0.4 npm http GET https://registry.npmjs.org/redis/0.6.7 npm http GET https://registry.npmjs.org/socket.io-client/0.9.6 npm http 304 https://registry.npmjs.org/policyfile/0.0.4 npm http 304 https://registry.npmjs.org/redis/0.6.7 npm http 304 https://registry.npmjs.org/socket.io-client/0.9.6 npm http GET https://registry.npmjs.org/uglify-js/1.2.5 npm http GET https://registry.npmjs.org/ws npm http GET https://registry.npmjs.org/xmlhttprequest/1.2.2 npm http GET https://registry.npmjs.org/active-x-obfuscator/0.0.1 npm http 304 https://registry.npmjs.org/uglify-js/1.2.5 npm http 304 https://registry.npmjs.org/xmlhttprequest/1.2.2 npm http 304 https://registry.npmjs.org/active-x-obfuscator/0.0.1 npm http 304 https://registry.npmjs.org/ws npm http GET https://registry.npmjs.org/zeparser/0.0.5 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/zeparser/0.0.5 npm http 304 https://registry.npmjs.org/options npm http 304 https://registry.npmjs.org/commander npm http 304 https://registry.npmjs.org/tinycolor

[email protected] install /root/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws node install.js

[ws v0.4.18] Attempting to compile blazing fast native extensions. [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).

这样的情况下其实开发也是可以进行的 如果用的是mac os, 装了xcode么?

回到顶部