如何在node.js npm服务器上查看socket.io版本

时间:2021-11-14 19:00:19

I want to confirm that should i upgrade to socket.io 0.7 , is my current app will not work on this server ? if i upgrade.

我想确认一下,如果我升级到socket.io 0.7,我的当前应用程序是否无法在此服务器上运行?如果我升级

For this i want to see my current socket.io version , how can i see that?

为此,我想看看我当前的socket.io版本,我怎么能看到它?

and also on other side i want to go for stable version of node , currently we are having v0.5.0 pre , want to go for stable ersion for socket.io i read in a question of * but not finding that question , lookoing for stable version to work with socket.io ,

而另一方面我想去稳定版本的节点,目前我们有v0.5.0 pre,想要为socket.io寻求稳定的版本我在*的问题中读到但没有找到那个问题,寻找稳定与socket.io一起使用的版本,

will it will affect on my currentop running app if yes then should i upgrade on other server?

它会影响我的currentop运行应用程序,如果是,那么我应该升级其他服务器?

3 个解决方案

#1


10  

For this i want to see my current socket.io version , how can i see that?

为此,我想看看我当前的socket.io版本,我怎么能看到它?

just open node.js in interactive mode by just typing node. Next you require('socket.io'). You will see a lot of information this way. If you just want to know your version number you could do require('socket.io').version.

只需键入node即可在交互模式下打开node.js。接下来你需要('socket.io')。你会以这种方式看到很多信息。如果您只想知道您的版本号,您可以要求('socket.io')。版本。

alfred@alfred-laptop:~/node/contact$ node
> require('socket.io');
{ version: '0.7.6',
  protocol: 1,
  clientVersion: '0.7.3',
  listen: [Function],
  Manager: 
   { [Function: Manager]
     defaultTransports: 
      [ 'websocket',
        'htmlfile',
        'xhr-polling',
        'jsonp-polling' ],
     static: { cache: {}, paths: [Object], mime: [Object] } },
  Transport: [Function: Transport],
  Socket: [Function: Socket],
  Store: { [Function: Store] Client: [Function] },
  MemoryStore: { [Function: Memory] Client: [Function: Client] },
  RedisStore: { [Function: Redis] Client: [Function: Client] },
  parser: 
   { packets: 
      [ 'disconnect',
        'connect',
        'heartbeat',
        'message',
        'json',
        'event',
        'ack',
        'error',
        'noop' ],
     reasons: 
      [ 'transport not supported',
        'client not handshaken',
        'unauthorized' ],
     advice: [ 'reconnect' ],
     encodePacket: [Function],
     encodePayload: [Function],
     decodePacket: [Function],
     decodePayload: [Function] } }

require('socket.io').version '0.7.6'

and also on other side i want to go for stable version of node , currently we are having v0.5.0 pre , want to go for stable ersion for socket.io i read in a question of * but not finding that question , lookoing for stable version to work with socket.io ,

而另一方面我想去稳定版本的节点,目前我们有v0.5.0 pre,想要为socket.io寻求稳定的版本我在*的问题中读到但没有找到那个问题,寻找稳定与socket.io一起使用的版本,

will it will affect on my currentop running app if yes then should i upgrade on other server?

它会影响我的currentop运行应用程序,如果是,那么我应该升级其他服务器?

node.js are self containable executables and you can install multiple version of node without any problems. You should have a look at nvm or nave to help you manage multiple version of node.js. With this you can run different apps in different versions of node.js/npm without any pain.

node.js是可自包含的可执行文件,您可以安装多个版本的节点而不会出现任何问题。你应该看看nvm或nave来帮助你管理node.js的多个版本。有了这个,您可以在不同版本的node.js / npm中运行不同的应用程序而不会有任何痛苦。

For example right now node.js is running node v0.4.9 by default

例如,现在node.js默认运行节点v0.4.9

alfred@alfred-laptop:~/node/contact$ nvm ls
v0.1.100  v0.1.16  v0.1.23  v0.1.30  v0.1.93  v0.2.0  v0.3.0  v0.3.7  v0.4.4
v0.1.101  v0.1.17  v0.1.24  v0.1.31  v0.1.94  v0.2.1  v0.3.1  v0.3.8  v0.4.5
v0.1.102  v0.1.18  v0.1.25  v0.1.32  v0.1.95  v0.2.2  v0.3.2  v0.4    v0.4.6
v0.1.103  v0.1.19  v0.1.26  v0.1.33  v0.1.96  v0.2.3  v0.3.3  v0.4.0  v0.4.7
v0.1.104  v0.1.20  v0.1.27  v0.1.90  v0.1.97  v0.2.4  v0.3.4  v0.4.1  v0.4.8
v0.1.14   v0.1.21  v0.1.28  v0.1.91  v0.1.98  v0.2.5  v0.3.5  v0.4.2  v0.4.8-rc
v0.1.15   v0.1.22  v0.1.29  v0.1.92  v0.1.99  v0.2.6  v0.3.6  v0.4.3  v0.4.9
stable:     v0.4.9
latest:     v0.4.9
current:    v0.4.9
default -> v0.4.9
# use 'nvm sync' to update from nodejs.org

alfred@alfred-laptop:~/node/contact$ node -v
v0.4.9

To change version I just type nvm use v0.4.8 which I have also installed.

要更改版本,我只需输入我已安装的nvm use v0.4.8。

alfred@alfred-laptop:~/node/contact$ nvm use v0.4.8
Now using node v0.4.8
alfred@alfred-laptop:~/node/contact$ node -v
v0.4.8

#2


6  

The above answer is now not working for recent versions of Socket.io library. Please have a look on below link for the latest answer for getting the version of socket.io:

上面的答案现在不适用于最新版本的Socket.io库。请查看以下链接,获取有关获取socket.io版本的最新答案:

require('socket.io/package').version;

Socket.IO Version Output

Socket.IO版本输出

#3


4  

To find out what is the current version, simply execute npm list socket.io on your current project in the command line.

要了解当前版本是什么,只需在命令行中对当前项目执行npm list socket.io即可。

#1


10  

For this i want to see my current socket.io version , how can i see that?

为此,我想看看我当前的socket.io版本,我怎么能看到它?

just open node.js in interactive mode by just typing node. Next you require('socket.io'). You will see a lot of information this way. If you just want to know your version number you could do require('socket.io').version.

只需键入node即可在交互模式下打开node.js。接下来你需要('socket.io')。你会以这种方式看到很多信息。如果您只想知道您的版本号,您可以要求('socket.io')。版本。

alfred@alfred-laptop:~/node/contact$ node
> require('socket.io');
{ version: '0.7.6',
  protocol: 1,
  clientVersion: '0.7.3',
  listen: [Function],
  Manager: 
   { [Function: Manager]
     defaultTransports: 
      [ 'websocket',
        'htmlfile',
        'xhr-polling',
        'jsonp-polling' ],
     static: { cache: {}, paths: [Object], mime: [Object] } },
  Transport: [Function: Transport],
  Socket: [Function: Socket],
  Store: { [Function: Store] Client: [Function] },
  MemoryStore: { [Function: Memory] Client: [Function: Client] },
  RedisStore: { [Function: Redis] Client: [Function: Client] },
  parser: 
   { packets: 
      [ 'disconnect',
        'connect',
        'heartbeat',
        'message',
        'json',
        'event',
        'ack',
        'error',
        'noop' ],
     reasons: 
      [ 'transport not supported',
        'client not handshaken',
        'unauthorized' ],
     advice: [ 'reconnect' ],
     encodePacket: [Function],
     encodePayload: [Function],
     decodePacket: [Function],
     decodePayload: [Function] } }

require('socket.io').version '0.7.6'

and also on other side i want to go for stable version of node , currently we are having v0.5.0 pre , want to go for stable ersion for socket.io i read in a question of * but not finding that question , lookoing for stable version to work with socket.io ,

而另一方面我想去稳定版本的节点,目前我们有v0.5.0 pre,想要为socket.io寻求稳定的版本我在*的问题中读到但没有找到那个问题,寻找稳定与socket.io一起使用的版本,

will it will affect on my currentop running app if yes then should i upgrade on other server?

它会影响我的currentop运行应用程序,如果是,那么我应该升级其他服务器?

node.js are self containable executables and you can install multiple version of node without any problems. You should have a look at nvm or nave to help you manage multiple version of node.js. With this you can run different apps in different versions of node.js/npm without any pain.

node.js是可自包含的可执行文件,您可以安装多个版本的节点而不会出现任何问题。你应该看看nvm或nave来帮助你管理node.js的多个版本。有了这个,您可以在不同版本的node.js / npm中运行不同的应用程序而不会有任何痛苦。

For example right now node.js is running node v0.4.9 by default

例如,现在node.js默认运行节点v0.4.9

alfred@alfred-laptop:~/node/contact$ nvm ls
v0.1.100  v0.1.16  v0.1.23  v0.1.30  v0.1.93  v0.2.0  v0.3.0  v0.3.7  v0.4.4
v0.1.101  v0.1.17  v0.1.24  v0.1.31  v0.1.94  v0.2.1  v0.3.1  v0.3.8  v0.4.5
v0.1.102  v0.1.18  v0.1.25  v0.1.32  v0.1.95  v0.2.2  v0.3.2  v0.4    v0.4.6
v0.1.103  v0.1.19  v0.1.26  v0.1.33  v0.1.96  v0.2.3  v0.3.3  v0.4.0  v0.4.7
v0.1.104  v0.1.20  v0.1.27  v0.1.90  v0.1.97  v0.2.4  v0.3.4  v0.4.1  v0.4.8
v0.1.14   v0.1.21  v0.1.28  v0.1.91  v0.1.98  v0.2.5  v0.3.5  v0.4.2  v0.4.8-rc
v0.1.15   v0.1.22  v0.1.29  v0.1.92  v0.1.99  v0.2.6  v0.3.6  v0.4.3  v0.4.9
stable:     v0.4.9
latest:     v0.4.9
current:    v0.4.9
default -> v0.4.9
# use 'nvm sync' to update from nodejs.org

alfred@alfred-laptop:~/node/contact$ node -v
v0.4.9

To change version I just type nvm use v0.4.8 which I have also installed.

要更改版本,我只需输入我已安装的nvm use v0.4.8。

alfred@alfred-laptop:~/node/contact$ nvm use v0.4.8
Now using node v0.4.8
alfred@alfred-laptop:~/node/contact$ node -v
v0.4.8

#2


6  

The above answer is now not working for recent versions of Socket.io library. Please have a look on below link for the latest answer for getting the version of socket.io:

上面的答案现在不适用于最新版本的Socket.io库。请查看以下链接,获取有关获取socket.io版本的最新答案:

require('socket.io/package').version;

Socket.IO Version Output

Socket.IO版本输出

#3


4  

To find out what is the current version, simply execute npm list socket.io on your current project in the command line.

要了解当前版本是什么,只需在命令行中对当前项目执行npm list socket.io即可。