如何安装旧版本的express.js

如何安装正确版本的Express,并且在安装2.x之前是否必须卸载3.x?

这是我试图testing的教程: http : //psitsmike.com/2011/09/node-js-and-socket-io-chat-tutorial/

我用这个package.json:

{ "name": "mukhin_chat", "description": "example chat application with socket.io", "version": "0.0.1", "dependencies": { "express": "2.4.6", "socket.io": "0.8.4" } } 

并使用以下命令:

 npm install -d 

当我运行应用程序,我仍然得到的问题:…你是从Express 2.x迁移到3.x …

这很容易,删除当前版本的快递,只需键入

 npm uninstall express 

接下来是以下命令来安装特定版本的软件包:

 npm install express@2.xx