How to Install socket.io on Node.js on Windows 7


Windows 7 32bit

Step 1: install Node.js

Download the Windows Installer:
Eg:http://nodejs.org/dist/v0.10.5/node-v0.10.5-x86.msi
You can find more available version of node js here: https://nodejs.org/en/download/releases/

You install Node.js …

Step 2: run CMD as Administrator

change dir to your application folder (ex: D:\AppServ\www\chat)

Step 3: install Socket.io

Use command: npm install socket.io@0.8.4

Result:
D:\AppServ\www\chat>npm install socket.io@0.8.4
npm WARN package.json chat@0.0.1 No README.md file found!
npm http GET https://registry.npmjs.org/socket.io/0.8.4
npm http 304 https://registry.npmjs.org/socket.io/0.8.4
npm http GET https://registry.npmjs.org/socket.io-client/0.8.4
npm http GET https://registry.npmjs.org/policyfile/0.0.4
npm http GET https://registry.npmjs.org/redis/0.6.6
npm http 304 https://registry.npmjs.org/policyfile/0.0.4
npm http 304 https://registry.npmjs.org/redis/0.6.6
npm http 304 https://registry.npmjs.org/socket.io-client/0.8.4
npm http GET https://registry.npmjs.org/uglify-js/1.0.6
npm http GET https://registry.npmjs.org/websocket-client/1.0.0
npm http GET https://registry.npmjs.org/xmlhttprequest/1.2.2
npm http 304 https://registry.npmjs.org/websocket-client/1.0.0
npm http 304 https://registry.npmjs.org/xmlhttprequest/1.2.2
npm http 304 https://registry.npmjs.org/uglify-js/1.0.6
socket.io@0.8.4 node_modules\socket.io
├── policyfile@0.0.4
├── redis@0.6.6
└── socket.io-client@0.8.4 (xmlhttprequest@1.2.2, websocket-client@1.0.0, uglify
-js@1.0.6)

Windows 7 64bit (update 12/18/2015)

Step 1: install Node.js

Download the Windows Installer:
Eg:https://nodejs.org/dist/v4.2.3/node-v4.2.3-x64.msi
You can find more available version of node js here: https://nodejs.org/en/download/releases/

You install Node.js …

nodejs windows 64bit install

Step 2: run CMD as Administrator

change dir to your application folder (ex: D:\AppServ\www\chat)

C:\Windows\system32>D:

D:\>cd D:\AppServ\www\chat

D:\AppServ\www\chat>

Step 3: install Socket.io

Use command: npm install socket.io@1.3.7

Result:
D:\AppServ\www\chat>npm install socket.io@1.3.7
npm WARN package.json chat@0.0.1 No repository field.
npm WARN package.json chat@0.0.1 No README data
npm WARN package.json chat@0.0.1 No license field.

> bufferutil@1.2.1 install D:\AppServ\www\chat\node_modules\socket.io\node_modul
es\engine.io\node_modules\ws\node_modules\bufferutil
> node-gyp rebuild

D:\AppServ\www\chat\node_modules\socket.io\node_modules\engine.io\node_modules\w
s\node_modules\bufferutil>if not defined npm_config_node_gyp (node "C:\Program F
iles\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\n
) e-gyp.js" rebuild ) else (node\ rebuild
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(29
7,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry.
TargetFrameworkVersion or PlatformToolset may be set to an invalid version nu
mber. [D:\AppServ\www\chat\node_modules\socket.io\node_modules\engine.io\node_m
odules\ws\node_modules\bufferutil\build\bufferutil.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x
64.targets(146,5): error MSB6006: "CL.exe" exited with code -1073741515. [D:\Ap
pServ\www\chat\node_modules\socket.io\node_modules\engine.io\node_modules\ws\no
de_modules\bufferutil\build\bufferutil.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\
npm\node_modules\node-gyp\lib\build.js:270:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_proces
s.js:200:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodej
s\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\AppServ\www\chat\node_modules\socket.io\node_modules\engine.io\n
ode_modules\ws\node_modules\bufferutil
gyp ERR! node -v v4.2.3
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok

> utf-8-validate@1.2.1 install D:\AppServ\www\chat\node_modules\socket.io\node_m
odules\engine.io\node_modules\ws\node_modules\utf-8-validate
> node-gyp rebuild

D:\AppServ\www\chat\node_modules\socket.io\node_modules\engine.io\node_modules\w
s\node_modules\utf-8-validate>if not defined npm_config_node_gyp (node "C:\Progr
am Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\b
in\node-gyp.js" rebuild ) else (node rebuild )
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(29
7,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry.
TargetFrameworkVersion or PlatformToolset may be set to an invalid version nu
mber. [D:\AppServ\www\chat\node_modules\socket.io\node_modules\engine.io\node_m
odules\ws\node_modules\utf-8-validate\build\validation.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x
64.targets(146,5): error MSB6006: "CL.exe" exited with code -1073741515. [D:\Ap
pServ\www\chat\node_modules\socket.io\node_modules\engine.io\node_modules\ws\no
de_modules\utf-8-validate\build\validation.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\
npm\node_modules\node-gyp\lib\build.js:270:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_proces
s.js:200:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodej
s\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\AppServ\www\chat\node_modules\socket.io\node_modules\engine.io\n
ode_modules\ws\node_modules\utf-8-validate
gyp ERR! node -v v4.2.3
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN optional dep failed, continuing bufferutil@1.2.1

> bufferutil@1.2.1 install D:\AppServ\www\chat\node_modules\socket.io\node_modul
es\socket.io-client\node_modules\engine.io-client\node_modules\ws\node_modules\b
ufferutil
> node-gyp rebuild

D:\AppServ\www\chat\node_modules\socket.io\node_modules\socket.io-client\node_mo
dules\engine.io-client\node_modules\ws\node_modules\bufferutil>if not defined np
m_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-b
in\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild
)
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(29
7,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry.
TargetFrameworkVersion or PlatformToolset may be set to an invalid version nu
mber. [D:\AppServ\www\chat\node_modules\socket.io\node_modules\socket.io-client
\node_modules\engine.io-client\node_modules\ws\node_modules\bufferutil\build\bu
fferutil.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x
64.targets(146,5): error MSB6006: "CL.exe" exited with code -1073741515. [D:\Ap
pServ\www\chat\node_modules\socket.io\node_modules\socket.io-client\node_module
s\engine.io-client\node_modules\ws\node_modules\bufferutil\build\bufferutil.vcx
proj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\
npm\node_modules\node-gyp\lib\build.js:270:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_proces
s.js:200:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodej
s\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\AppServ\www\chat\node_modules\socket.io\node_modules\socket.io-c
lient\node_modules\engine.io-client\node_modules\ws\node_modules\bufferutil
gyp ERR! node -v v4.2.3
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN optional dep failed, continuing utf-8-validate@1.2.1

> utf-8-validate@1.2.1 install D:\AppServ\www\chat\node_modules\socket.io\node_m
odules\socket.io-client\node_modules\engine.io-client\node_modules\ws\node_modul
es\utf-8-validate
> node-gyp rebuild

D:\AppServ\www\chat\node_modules\socket.io\node_modules\socket.io-client\node_mo
dules\engine.io-client\node_modules\ws\node_modules\utf-8-validate>if not define
d npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-g
yp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebu
ild )
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(29
7,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry.
TargetFrameworkVersion or PlatformToolset may be set to an invalid version nu
mber. [D:\AppServ\www\chat\node_modules\socket.io\node_modules\socket.io-client
\node_modules\engine.io-client\node_modules\ws\node_modules\utf-8-validate\buil
d\validation.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x
64.targets(146,5): error MSB6006: "CL.exe" exited with code -1073741515. [D:\Ap
pServ\www\chat\node_modules\socket.io\node_modules\socket.io-client\node_module
s\engine.io-client\node_modules\ws\node_modules\utf-8-validate\build\validation
.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\
npm\node_modules\node-gyp\lib\build.js:270:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_proces
s.js:200:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodej
s\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\AppServ\www\chat\node_modules\socket.io\node_modules\socket.io-c
lient\node_modules\engine.io-client\node_modules\ws\node_modules\utf-8-validate
gyp ERR! node -v v4.2.3
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN optional dep failed, continuing bufferutil@1.2.1
npm WARN optional dep failed, continuing utf-8-validate@1.2.1
socket.io@1.3.7 node_modules\socket.io
├── has-binary-data@0.1.3 (isarray@0.0.1)
├── debug@2.1.0 (ms@0.6.2)
├── socket.io-parser@2.2.4 (isarray@0.0.1, debug@0.7.4, component-emitter@1.1.2,
benchmark@1.0.0, json3@3.2.6)
├── socket.io-adapter@0.3.1 (object-keys@1.0.1, debug@1.0.2, socket.io-parser@2.
2.2)
├── engine.io@1.5.4 (base64id@0.1.0, debug@1.0.3, engine.io-parser@1.2.2, ws@0.8
.0)
└── socket.io-client@1.3.7 (to-array@0.1.3, debug@0.7.4, indexof@0.0.1, object-c
omponent@0.0.3, component-bind@1.0.0, backo2@1.0.2, component-emitter@1.1.2, has
-binary@0.1.6, parseuri@0.0.2, engine.io-client@1.5.4)

Leave a Reply