我是全新的nodemon。 Nodemon index.js
這裏是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...');
以下這部影片的步驟,在12:01 https://www.youtube.com/watch?v=eB9Fq9I5ocs 後, 嘗試使用nodemon運行我的應用程序時,我得到以下錯誤這裏是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的代碼嗎?抱歉,也可能會發布文件夾結構 –
。只是更新了問題 – Chris