升级到 nativescript 2.2.1 后,运行应用程序时出现此错误:
java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException:
Error calling module function
TypeError: global.moduleMerge is not a function
File: "<unknown>, line: 1, column: 265
StackTrace:
Frame: function:'', file:'/data/data/org.nativescript.hw1/files/app/tns_modules/utils/utils.js', line: 3, column: 8
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'/data/data/org.nativescript.hw1/files/app/tns_modules/file-system/file-system-access.js', line: 2, column: 13
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'/data/data/org.nativescript.hw1/files/app/tns_modules/file-system/file-system.js', line: 1, column: 86
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'/data/data/org.nativescript.hw1/files/app/tns_modules/nativescript-angular/file-system/ns-file-system.js', line: 2, column: 21
Frame: function:'require', file:'', line: 1, column: 26
我试图删除 ./node_modules 和 ./platform 文件夹,以确保一切都是新鲜的,但这无济于事。
这是我的依赖项(来自 package.json):
"dependencies": {
"@angular/common": "2.0.0-rc.4",
"@angular/compiler": "2.0.0-rc.4",
"@angular/core": "2.0.0-rc.4",
"@angular/http": "2.0.0-rc.4",
"@angular/platform-browser": "2.0.0-rc.4",
"@angular/platform-browser-dynamic": "2.0.0-rc.4",
"@angular/platform-server": "2.0.0-rc.4",
"@angular/router": "3.0.0-beta.2",
"@angular/router-deprecated": "2.0.0-rc.2",
"nativescript-angular": "next",
"reflect-metadata": "^0.1.5",
"tns-core-modules": "2.2.1",
"email-validator": "^1.0.4",
"nativescript-social-share": "^1.2.0"
},
"devDependencies": {
"babel-traverse": "6.13.0",
"babel-types": "6.13.0",
"babylon": "6.9.0",
"lazy": "1.0.11",
"nativescript-dev-typescript": "^0.3.2",
"typescript": "^1.8.10"
}