dlresende/extreme-carpaccio

Server does not start (npm 6.4.10)

Closed this issue · 0 comments

Server does not start when running npm run start (npm version: 6.4.1). Error:

internal/validators.js:113
    throw err;
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "interval" argument must be of type number. Received type object
    at StatWatcher.start (internal/fs/watchers.js:76:3)
    at Object.watchFile (fs.js:1322:10)
    at Configuration.watch (/home/CODE/extreme-carpaccio/server/javascripts/config.js:65:16)
    at Object.<anonymous> (/home/CODE/extreme-carpaccio/server/app.js:26:15)
    at Module._compile (internal/modules/cjs/loader.js:723:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:734:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
    at Function.Module._load (internal/modules/cjs/loader.js:552:3)
    at Module.require (internal/modules/cjs/loader.js:659:17)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! extreme-carpaccio-server@1.0.0 start: `node bin/www`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the extreme-carpaccio-server@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

It is caused by configuration.watch(); line in app.js not passing any parameters. Due to that callback, watchOnce, interval are undefined and the error this thrown.

I've checked if this worked on earlier versions of npm and found out that it works in version 2.15.11 despite those parameters being undefined.

I'll create a merge request resolving this issue, but the way I do it might not be the best.

Edit:
I verified it on another machine as well - the same thing happens