在我升级到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"
}发布于 2016-08-24 21:25:56
遵循Alexander Vakrilov的建议,在这里issue 393,并确保main.ts中的第一个导入是import {nativeScriptBootstrap} from "nativescript-angular/application";解决了这个问题。
https://stackoverflow.com/questions/39037660
复制相似问题