【发布时间】:2017-06-30 15:07:34
【问题描述】:
我是 nodemon 的新手。在 12:01 https://www.youtube.com/watch?v=eB9Fq9I5ocs 遵循此视频中的步骤后 , 尝试使用 nodemon 运行我的应用程序时出现以下错误:
这是 APP.JS 文件:
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
var mongoose = require('mongoose');
// Connect to Mongoose
mongoose.connect('mongodb://localhost/ChatbotService')
var db = mongoose.connection;
app.get('/', function(req, res){
res.send('Hola4');
});
app.listen(8601);
console.log('Running on port 8601...');
这是 PACKAGE.JSON 文件:
{
"name": "chatbot",
"version": "1.0.0",
"description": "chatbot app",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"express": "*",
"body-parser": "*",
"mongoose": "*"
},
"author": "Chris",
"license": "ISC",
"devDependencies": {
"nodemon": "^1.11.0"
}
}
我需要做什么才能让 nodemon 找到 index.js 模块?
谢谢
【问题讨论】:
-
你能贴出你用来初始化nodemon的代码吗?发布您的文件夹结构可能会有所帮助
-
对不起。刚刚更新了问题
标签: node.js mongodb express nodemon