0

我正在尝试在 Cloud9 上部署一个简单的 derby 项目。

我使用 Node.js 创建了一个工作区,并添加了以下 4 个文件的内容。

索引.html:

<Body:>
  <!--Templates define both HTML and model-view bindings-->
  Holler: <input value="{{hello.message}}">
  <h2>{{hello.message}}</h2>

index.js:

var app = module.exports = require('derby').createApp('hello', __filename);
app.loadViews(__dirname);

// Routes render on client as well as server
app.get('/', function(page, model) {
  // Subscribe specifies the data to sync
  model.subscribe('hello.message', function() {
    page.render();
  });
});

server.js:

require('derby-starter').run(__dirname, {port: process.env.PORT});

包.json:

{
  "name": "derby-examples",
  "description": "Example applications for the Derby framework",
  "version": "0.6.0",
  "repository": "",
  "main": "server.js",
  "dependencies": {
    "derby": "0.6.0-alpha41",
    "derby-starter": "^0.2.6",
    "derby-stylus": "~0.1.0",
    "express": "~3.18.0",
    "d-connection-alert": "~0.1.0",
    "d-before-unload": "~0.1.0",
    "d-bootstrap": "~0.1.0",
    "d-codemirror": "~0.2.0",
    "d-showdown": "~0.1.0",
    "derby-debug": "^0.1.0"
  },
  "optionalDependencies": {},
  "devDependencies": {},
  "engines": {
    "node": "0.10.x"
  }
}

当我启动服务器时,它一直在说

Important: use process.env.PORT as the port and process.env.IP as the host in your scripts!                                                                                             

debugger listening on port 15454                                                                                                                                                        
Master pid  27985                                                                                                                                                                       
debugger listening on port 15454                                                                                                                                                        
Failed to open socket on port 15454, waiting 1000 ms before retrying                                                                                                                    

并继续

Failed to open socket on port 15454, waiting 1000 ms before retrying                                                                                                                    

如何正确启动服务器?

4

1 回答 1

0

此错误来自调试器,您可以将其关闭并重试吗?您可以通过单击运行面板上的绿色错误图标来关闭调试器。

于 2015-05-25T09:52:29.200 回答