Running grunt-nodemon throws module not found error.

176 views Asked by At

I have gruntfile in node app (node version -4.2.2, npm version - 2.14.7) as below:

 // watch node server for changes
            nodemon: {
                default: {
                    script: 'server.js'
                }
            },

Running command grunt throws error as below:

[nodemon] starting `node server.js`
Debugger listening on port 5858
 module.js:339
    throw err;
    ^

Error: Cannot find module 'C:\workspace\start.js'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.Module._load (module.js:287:25)
    at Function.Module.runMain (module.js:467:10)
    at startup (node.js:136:18)
    at node.js:963:3
 [nodemon] app crashed - waiting for file changes before starting...

I have both gruntfile.js and server.js files at the app root as below:

C:\workspace\myApp
   - gruntfile.js
   - server.js

If i change the script file path in grunfile.js as below it works:

 // watch node server for changes
            nodemon: {
                default: {
                    script: 'myApp/start.js'
                }
            },  
0

There are 0 answers