简体   繁体   English

如何在 node.js 上安装 Socket.io?

[英]how to install Socket.io over node.js?

I will need any help i can get to install socket.io over node.js for server.我需要任何帮助才能为服务器安装 socket.io 而不是 node.js。

I have already installed the node from the site.我已经从站点安装了节点。 I am interested in step- by step(directory,etc) as i am new to programming.我对逐步(目录等)很感兴趣,因为我是编程新手。 Thanks in advance James在此先感谢詹姆斯

The easy way to install socket.io is with npm (Node Package Manager).安装 socket.io 的简单方法是使用 npm(节点 Package Manager)。 npm is the default package manager for Node.js.The current Windows installer from nodejs.org will install npm along with Node.js. In Windows OS, open the cmd window and type: npm is the default package manager for Node.js.The current Windows installer from nodejs.org will install npm along with Node.js. In Windows OS, open the cmd window and type:

npm install socket.io  

This command will install socket.io in the local node_modules folder, which is owned by the current user.此命令将在当前用户拥有的本地node_modules文件夹中安装 socket.io。

npm can also take optional flags which are described at the npm-install webpage of www.npmjs.org . npm 也可以采用可选标志,这些标志在www.npmjs.orgnpm-install网页上有描述。

In order to test if socket.io is working, try this tutorial: Get Started: Chat application which has been linked to by Beterraba in a comment below your question.为了测试 socket.io 是否正常工作,请尝试此教程:入门:Beterraba 在您的问题下方的评论中链接到的聊天应用程序

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM