SyntaxError: node_modules/fsevents/node_modules/mkdirp/bin/cmd.js: 'return' outside of function (13:4)
11 | if (argv.help) {
12 | fs.createReadStream(__dirname + '/usage.txt').pipe(process.stdout);
13 | return;
| ^
14 | }
15 |
16 | var paths = argv._.slice();_
node v8.3.0
That's not in fsevents though, but in mkdirp.
That SyntaxError looks very suspicious though. Can you post exact steps to reproduce? Are you using any other tooling besides plain node + fsevents, like babel or gulp?
I think you're using Babel to transpile the code and unfortunately you set the babel to compile the node_module as well (which is actually overkill). Pls move your code into ./src folder then set the babel compile such as babel ./src -d ./dist will solve the problem.
Thank you @trumhemcut for the explanation. Closing.
@trumhemcut thnx your recommendation helped me!
Most helpful comment
I think you're using Babel to transpile the code and unfortunately you set the babel to compile the node_module as well (which is actually overkill). Pls move your code into ./src folder then set the babel compile such as
babel ./src -d ./distwill solve the problem.