[英]Nativescript error on build
我在ubuntu服務器上運行nativescript,當我運行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
我已經安裝了這些版本:npm 1.3.10 node v0.10.25
我知道“ let”關鍵字是ES6的一部分,但是如何解決此問題? 謝謝!
您需要升級節點版本。 獲得體面的ES6支持; 您確實希望最少帶有和聲標志的Node4.x。 從技術上講,如果使用和聲標志,則早期版本的Node可以使用“ let”命令。 但是在v4之前的支持不是很好。
為獲得真正的良好支持而不必使用和聲標志; 當前的LTS(6.9.x)對ES6功能有很好的支持。
此錯誤的一件事是表明該文件沒有"use strict";
在里面; 因此,除非您要手動更改該文件,否則可能只想使用當前的LTS Node 6.9.x(或更高版本); 因為它不再需要"use strict";
使用ES6功能。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.