Node.js + Socket.io + Windows 7 / 8?

后端 未结 11 1829
迷失自我
迷失自我 2021-02-07 05:29

I\'ve been searching everywhere, but can\'t seem to find a solution. Is it possible to install Socket.io on Node.js on Windows 7?

If not, is there some sort of alternati

11条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-07 05:50

    npm runs on Node.js. If you are having problems running npm, then you should also be having problems with Node.js. Assuming you are running Node.js through Cygwin, then you should be able to run

    node npm install socket.io
    

    (Which is the same as npm install socket.io)

    Also.

    Npm is just the Node.js package manager. There is nothing that it provides that you can't get from the repositories themselves. It is just, for obvious reasons, a lot easier to use npm.

    If you want the socket.io included, then just create a node_modules directory inside of your /lib directory or wherever your project is, and then clone the socket.io to it.

    https://github.com/LearnBoost/socket.io


    Edit

    The OP indicated that he is using node.exe. There is no way currently as of 1st September 2011 to use npm with node.exe. It is currently on the node.exe roadmap and will hopefully be completed soon, but not as of today. (Check the mailing list if you want to be updated).

提交回复
热议问题