Fsevents: return is error

Created on 11 Aug 2017  路  5Comments  路  Source: fsevents/fsevents

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();_

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 ./dist will solve the problem.

All 5 comments

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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jackyon picture jackyon  路  8Comments

guidobouman picture guidobouman  路  6Comments

noelheesen picture noelheesen  路  6Comments

kroschu picture kroschu  路  7Comments

ywang1724 picture ywang1724  路  9Comments