2012-08-16 61 views
3

運行在Windows 7家庭高級版64位如何安裝在Windows 7 socket.io 64(node.js的)

下載:

再接着在http://blog.nowjs.com/running-nowjs-natively-on-windows的步驟,這意味着在:

  • 安裝Microsoft Visual C++運行(我得到了x64版)
  • 抓住一個「固定的窗口」從版本now.js的github.com/Flotype/now/zipball/windows

隨着一切設置到位,運行任何需要'now'模塊的示例都會導致請求socket.io模塊。

運行 '故宮安裝socket.io -g' 的輸出:

C:\Windows\System32>npm install socket.io -g 
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/socket.io-client/0.9.10 
npm http GET https://registry.npmjs.org/redis/0.7.2 
npm http 304 https://registry.npmjs.org/policyfile/0.0.4 
npm http 304 https://registry.npmjs.org/socket.io-client/0.9.10 
npm http 304 https://registry.npmjs.org/redis/0.7.2 
npm http GET https://registry.npmjs.org/hiredis 
npm http GET https://registry.npmjs.org/uglify-js/1.2.5 
npm http GET https://registry.npmjs.org/xmlhttprequest/1.4.2 
npm http GET https://registry.npmjs.org/ws 
npm http GET https://registry.npmjs.org/active-x-obfuscator/0.0.1 
npm http 304 https://registry.npmjs.org/hiredis 
npm WARN package.json [email protected] No README.md file found! 

> [email protected] preinstall C:\Program Files\nodejs\node_modules\socket.io\node_ 
modules\redis\node_modules\hiredis 
> make || gmake 

cd deps/hiredis && make static 
process_begin: CreateProcess(NULL, sh -c "type cc >/dev/null 2>/dev/null && echo 
cc || echo gcc", ...) failed. 
process_begin: CreateProcess(NULL, sh -c "uname -s 2>/dev/null || echo not", ... 
) failed. 
make[1]: Entering directory `C:/Program Files/nodejs/node_modules/socket.io/node 
_modules/redis/node_modules/hiredis/deps/hiredis' 
std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g 
-ggdb net.c 
'std' não é reconhecido como um comando interno 
ou externo, um programa operável ou um arquivo em lotes. 
make[1]: [net.o] Error 1 (ignored) 
std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g 
-ggdb hiredis.c 
'std' não é reconhecido como um comando interno 
ou externo, um programa operável ou um arquivo em lotes. 
make[1]: [hiredis.o] Error 1 (ignored) 
std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g 
-ggdb sds.c 
'std' não é reconhecido como um comando interno 
ou externo, um programa operável ou um arquivo em lotes. 
make[1]: [sds.o] Error 1 (ignored) 
std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g 
-ggdb async.c 
'std' não é reconhecido como um comando interno 
ou externo, um programa operável ou um arquivo em lotes. 
make[1]: [async.o] Error 1 (ignored) 
ar rcs libhiredis.a net.o hiredis.o sds.o async.o 
process_begin: CreateProcess(NULL, ar rcs libhiredis.a net.o hiredis.o sds.o asy 
nc.o, ...) failed. 
make (e=2): O sistema não pode encontrar o arquivo especificado. 
make[1]: *** [libhiredis.a] Error 2 
make[1]: Leaving directory `C:/Program Files/nodejs/node_modules/socket.io/node_ 
modules/redis/node_modules/hiredis/deps/hiredis' 
make: *** [all] Error 2 
'gmake' não é reconhecido como um comando interno 
ou externo, um programa operável ou um arquivo em lotes. 
npm WARN optional dep failed, continuing [email protected] 
npm http 304 https://registry.npmjs.org/uglify-js/1.2.5 
npm http 304 https://registry.npmjs.org/xmlhttprequest/1.4.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/commander 
npm http 304 https://registry.npmjs.org/tinycolor 
npm http 304 https://registry.npmjs.org/options 

> [email protected] install C:\Program Files\nodejs\node_modules\socket.io\node_modules\ 
socket.io-client\node_modules\ws 
> node install.js 

[ws v0.4.21] Attempting to compile blazing fast native extensions. 
[ws v0.4.21] Native code compile failed (but the module will still work): 
[ws v0.4.21] The native extensions are faster, but not required. 
[ws v0.4.21] On Windows, native extensions require Visual Studio and Python. 
[ws v0.4.21] On Unix, native extensions require Python, make and a C++ compiler. 

[ws v0.4.21] Start npm with --ws:verbose to show compilation output (if any). 
[email protected] C:\Program Files\nodejs\node_modules\socket.io 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] ([email protected], [email protected], active-x-obf 
[email protected], [email protected]) 

我缺少的東西?還嘗試使用node.js的0.8.6-x64和0.8.5-x64版本,兩者都打包爲msi。

此外,將固定的窗口版本now.js直接在node_modules文件夾INSITE的helloworld_server.js例子並運行「節點helloworld_server.js」產生:

[Error: no errorc:\xampp\htdocs\node-tcg\node_modules\now\bin\proxy.node] 
Error: no errorc:\xampp\htdocs\node-tcg\node_modules\now\bin\proxy.node 
    at Object.Module._extensions..node (module.js:485:11) 
    at Module.load (module.js:356:32) 
    at Function.Module._load (module.js:312:12) 
    at Module.require (module.js:362:17) 
    at require (module.js:378:17) 
    at Object.<anonymous> (c:\xampp\htdocs\node-tcg\node_modules\now\lib\proxy.j 
s:10:13) 
    at Module._compile (module.js:449:26) 
    at Object.Module._extensions..js (module.js:467:10) 
    at Module.load (module.js:356:32) 
    at Function.Module._load (module.js:312:12) 

回答

0

任何人誰發現這在谷歌: 我正在運行Windows 8 x64,並有大量問題試圖安裝socket.io和其他擴展到node.js由於編譯器問題。我試圖下載/安裝GNU Make,Visual Studio Express,Visual Studio Ultimate(試用):基本上推薦的所有東西。仍然沒有骰子。 Socket.io不會工作。

對我來說最簡單的解決方案就是在虛擬機裏運行linux並使用它。 - 下載x86版本的Lubuntu Linux(非常類似於Windows):http://lubuntu.net/ - 在VirtualBox中安裝Linux:https://www.virtualbox.org/ - 在Lubuntu的VirtualBox網絡設置中使用「橋接適配器」。這將允許您從Windows機器訪問節點服務器。 - 在Lubuntu上安裝節點和其他任何你想要的東西。 Node最初是爲Linux設計的,所以一切都完美無瑕。 - 最後安裝一些附加軟件只需要4GB的硬盤空間。一點也不差!