Reputation: 31
Running on a Windows 7 Home Premium 64-bits
Downloaded:
And then followed the steps at http://blog.nowjs.com/running-nowjs-natively-on-windows, which implied on:
With everything set in place, running any example that requires the 'now' module results in a request for socket.io module.
Running 'npm install socket.io -g' outputs:
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])
Am I missing something? Also tried with versions 0.8.6-x64 and 0.8.5-x64 of node.js, both also packaged as msi.
Additionally, placing the fixed-for-windows version of now.js directly in a node_modules folder insite the helloworld_server.js example and running 'node helloworld_server.js' produces:
[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)
Upvotes: 3
Views: 4451
Reputation: 93
Anyone who find this on google: I'm running Windows 8 x64 and had tons of issues trying to install socket.io and other extensions into node.js due to compiler issues.
I tried downloading/installing GNU Make, Visual Studio Express, Visual Studio Ultimate (trial): basically everything that's recommended. Still no dice. Socket.io WOULDN'T WORK.
The easiest solution for me has been to just run linux inside a virtual machine and use node from that. - Download the x86 version of Lubuntu Linux(Very windows like): http://lubuntu.net/ - Install Linux in VirtualBox: https://www.virtualbox.org/ - Use "Bridged Adapter" inside network settings of VirtualBox for Lubuntu. This will allow you to access the node server from your windows machine. - Install node and whatever else you want onto Lubuntu. Node was initially designed for linux, so everything works flawlessly. - The final installation with a few extras only takes 4GB on my hard drive. Not bad at all!
Upvotes: 0