Can anyone help me with this SyntaxError? I keep getting it on various paths not only mongoose, sometimes is bluebird sometimes another module.
Tried and deleted the node_modules folder and reinstall the npm modules which fixes the issue but after a couple of runs of the script, it appears again.
I honestly can't explain why it works after reinstalling the node_modules and after a few runs, it doesn't anymore.
Node: v9.8.0 NPM: 5.7.1
node_modules/mongoose/lib/options.js:1
(function (exports, require, module, __filename, __dirname) {
SyntaxError: Invalid or unexpected token
at new Script (vm.js:51:7)
at createScript (vm.js:136:10)
at Object.runInThisContext (vm.js:197:10)
at Module._compile (module.js:613:28)
at Object.Module._extensions..js (module.js:660:10)
at Module.load (module.js:561:32)
at tryModuleLoad (module.js:501:12)
at Function.Module._load (module.js:493:3)
at Module.require (module.js:593:17)
at require (internal/module.js:11:18)