- I am a beginner at NodeJS stuff.
- Environment is Windows 7 64 Bit.
- Node is installed and working.
- NPM is also working fine.
- Nodemon is installed. (In App and also Globally)
Now when I run the command:
"nodemon server.js" or just "nodemon"
it gives the following error:
module.js:549
throw err;
^
Error: Cannot find module 'C:\Program Files\Git\node_modules\nodemon\bin\nodemon.js'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:188:16)
at bootstrap_node.js:609:3
- I don't understand what this means? And why is it looking inside the Git folder?
- Does it have to do anything with Environment Variable? But Node and NPM are both working fine.
- Any ideas/suggestion/solution?
Below is my "server.js" file in case you need for reference.
var express = require("express");
var bodyParser = require("body-parser");
var morgan = require("morgan");
var path = require("path");
var app = express();
app.use(bodyParser.urlencoded({extended: true}));
app.use(bodyParser.json());
app.use(function (req, es, next) {
res.setHeader("Access-Control-Allow-Origin", "*");
res.setHeader("Access-Control-Allow-Methods", "GET, POST");
res.setHeader("Access-Control-Allow-Headers", "X-Requested-With, content-type, Authorization");
next();
});
app.use(morgan("dev"));
app.use(express.static(__dirname + "/app"));
app.get("*", function (req, res) {
res.sendFile(path.join(__dirname + "/index.html"));
});
app.listen(8080);
console.log(">>>>> App is Running <<<<<");