【发布时间】:2014-07-18 14:18:22
【问题描述】:
我正在通过 npm start 运行我的 nodejs 应用程序
我刚刚安装了 nodemon
sudo npm install -g nodemon 这样我就可以在保存对文件的更改时重新启动服务器。
但是当我尝试启动服务器时,像这样
nodemon ./app.js localhost 3000 or nodemon start localhost 3000
我得到这个作为输出
LM-SJC-00871929:webapp gdeep$ nodemon ./app.js localhost 3000
28 May 23:34:30 - [nodemon] v1.1.1
28 May 23:34:30 - [nodemon] to restart at any time, enter `rs`
28 May 23:34:30 - [nodemon] watching: *.*
28 May 23:34:30 - [nodemon] starting `node ./app.js localhost 3000`
但是当我去我的网页时,我得到了
Oops! Google Chrome could not connect to localhost:3000。我做错了什么?
App.js 在这里http://collabedit.com/t35dy
【问题讨论】:
-
您的问题可能与 nodemon 无关。发布
app.js的内容 -
我刚刚添加了 app.js 作为问题的一部分。感谢您的帮助。
-
运气好吗?我有同样的问题,“开始”但不工作