With this file, tmp, with +x permissions:
#!/usr/bin/env node
'syntax error
node tmp in node 12 / nvm run 12 tmp begets:
$PWD/tmp:3
'syntax error
^^^^^^^^^^^^^
SyntaxError: Invalid or unexpected token
at Module._compile (internal/modules/cjs/loader.js:895:18)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Function.Module._load (internal/modules/cjs/loader.js:727:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
at internal/main/run_main_module.js:17:11
node tmp in node 13.6 / nvm run 13 tmp begets:
$PWD/tmp:1
#!/usr/bin/env node
^
SyntaxError: Invalid or unexpected token
at wrapSafe (internal/modules/cjs/loader.js:1060:16)
at Module._compile (internal/modules/cjs/loader.js:1108:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1164:10)
at Module.load (internal/modules/cjs/loader.js:993:32)
at Function.Module._load (internal/modules/cjs/loader.js:892:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47
The error message in node 13 was highly confusing and I had no idea where the syntax error was in the actual file (which was obviously much larger) until I thought to test it in node 12.
With this file,
tmp, with+xpermissions:node tmpin node 12 /nvm run 12 tmpbegets:node tmpin node 13.6 /nvm run 13 tmpbegets:The error message in node 13 was highly confusing and I had no idea where the syntax error was in the actual file (which was obviously much larger) until I thought to test it in node 12.