node.js - NPM - Can't install socket.IO -
i trying install socket.io on windows npm use on nodejs server.
first, when typed "npm install socket.io" had error in log saying python , node-gyp. installed python 2.7.3 , set environment variables.
now got new error, has visual studio (what hell vs have npm ? compiler? ).
the error same here npm install packages (sqlite3, socket.io) fail error msb8020 on windows 7 when use option in answer instead of error tells me possible data loss (c4267) doesn't log error.
then when start app, tells me cannot find module socket.io still come ?
oh , when npm config root tells me "undefined" have ? should install modules globally or locally ?
at least 1 of packages in socket.io's dependency tree c/c++ addons needs compiled on system it's installed. and, since it's dependency, if doesn't succeed in installing, neither socket.io.
to enable cross-system compilation, node.js uses node-gyp
build system. you'll need have installed global package:
npm install -g node-gyp
as have its dependencies installed. abridged version:
- python 2
- c/c++ compiler / build tools
- for windows, microsoft visual studio 2013 (c++ or windows desktop) (express edition)
- for 64-bit, may need windows 7 64-bit sdk
- for windows, microsoft visual studio 2013 (c++ or windows desktop) (express edition)
then, should able install socket.io local package can require
it:
npm install socket.io
Comments
Post a Comment