2013-05-28 41 views
1

当我尝试应用在Heroku的这个简单的节点的应用程序,我得到了错误:是由heroku支持的dnode吗?

no port or path provided 

这里是应用程序:

server.js

,这里是浏览器指数.html

<html> 
<head> 
    <script src="/dnode.js" type="text/javascript"></script> 
    <script type="text/javascript"> 
     window.onload = function() { 

      DNode.connect(function (remote) { 
       remote.zing(66, function (n) { 
        document.getElementById('result').innerHTML = n; 
       }); 
      }); 

     }; 
    </script> 
</head> 
<body> 

n = <span id="result">?</span> 

</body> 
</html> 

然后,heroku日志:

2013-05-28T18:38:55.246545+00:00 app[web.1]:   throw new Error('no port or path provided'); 
2013-05-28T18:38:55.249503+00:00 app[web.1]:  at D.dnode.listen (/app/node_modules/dnode/index.js:119:15) 
2013-05-28T18:38:55.249503+00:00 app[web.1]:  at Object.<anonymous> (/app/app.js:20:8) 
2013-05-28T18:38:55.246124+00:00 app[web.1]: /app/node_modules/dnode/index.js:119 
2013-05-28T18:38:55.249503+00:00 app[web.1]:  at node.js:901:3 
2013-05-28T18:38:55.249503+00:00 app[web.1]:  at Module._compile (module.js:456:26) 
2013-05-28T18:38:55.249503+00:00 app[web.1]:  at Function.Module.runMain (module.js:497:10) 
2013-05-28T18:38:55.246854+00:00 app[web.1]:    ^
2013-05-28T18:38:55.249503+00:00 app[web.1]:  at startup (node.js:119:16) 
2013-05-28T18:38:55.249503+00:00 app[web.1]:  at Module.load (module.js:356:32) 
2013-05-28T18:38:55.249503+00:00 app[web.1]: Error: no port or path provided 
2013-05-28T18:38:55.249503+00:00 app[web.1]:  at Object.Module._extensions..js (module.js:474:10) 
2013-05-28T 
18:38:55.249503+00:00 app[web.1]:  at Function.Module._load (module.js:312:12) 
2013-05-28T18:38:56.512438+00:00 heroku[web.1]: Process exited with status 8 
2013-05-28T18:38:56.530982+00:00 heroku[web.1]: State changed from starting to crashed 
2013-05-28T18:39:04.462914+00:00 heroku[web.1]: Stopping process with SIGKILL 
2013-05-28T18:39:04.462914+00:00 heroku[web.1]: Error R99 (Platform error) -> Failed to launch the dyno within 10 seconds 

有什么我失踪?

回答

0

您使用的是旧版本的API(< 1)。新版本只是一个流。检查当前的自述文件以获取如何pipe everything together with the new api

+0

我试过了,但是,我无法在heroku上安装鞋,请看我在这里得到的答案http://stackoverflow.com/questions/16692315/failed-to-rebuild-dependencies-with-npm它会工作如果我可以用express来使用它.. – simo

+0

那么,我不能在不使用鞋的情况下在浏览器中使用它?只是表达? – simo