Reputation: 89
I'm running nativescript on an ubuntu server and I have an issue when I run tns build android.
/home/nativescript/sample-Groceries/platforms/android/build-tools/check-v8-dependants.js:3
let args = process.argv;
^^^
SyntaxError: Unexpected strict mode reserved word
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:902:3
I heve those versions installed: npm 1.3.10 node v0.10.25
I know that "let" keywords are part of ES6, but how can I fix this issue? Thank you!
Upvotes: 0
Views: 187
Reputation: 5399
You need to upgrade your node version. For decent ES6 support; you really want a minimum of Node 4.x with the harmony flags. Technically, If you use the harmony flag, then earlier versions of Node can use the "let" command. But support before v4 was not great.
For really good support without having to use the harmony flags; the current LTS (6.9.x) has very good support for ES6 functionality.
One thing this error is signifying that the file does not have a "use strict";
in it; so unless you want to manually change that file, you may be just want to use the current LTS Node 6.9.x (or later); as it no longer requires the "use strict";
to use ES6 functionaliy.
Upvotes: 3