【发布时间】:2017-10-23 07:36:06
【问题描述】:
我正在尝试使用 typescript 创建一个新的 2.5 项目。
tns info 表示 NS 为 2.5.3,tns-core-modules 为 2.5.2。
tns 创建测试 --template tsc
编译时出现以下错误:
`
从 C:\Users\pc\nativescript\sd4\hooks\before-prepare\nativescript-dev-android-snapshot.js 执行 before-prepare 钩子 从 C:\Users\pc\nativescript\sd4\hooks\before-prepare\nativescript-dev-typescript.js 执行 before-prepare 钩子 找到对等的 TypeScript 2.2.2 app/app.ts(8,22):错误 TS2307:找不到模块“应用程序”。
app/bundle-config.ts(1,11):错误 TS2304:找不到名称“全局”。
app/bundle-config.ts(3,5):错误 TS2304:找不到名称 'require'。
app/bundle-config.ts(6,5):错误 TS2304:找不到名称“全局”。 app/bundle-config.ts(6,46): 错误 TS2304: 找不到名称 'require'。
app/main-page.ts(8,22): 错误 TS2307: 找不到模块 'ui/page'。
app/main-view-model.ts(23,18):错误 TS2339:“HelloWorldModel”类型上不存在属性“notifyPropertyChange”。
`
【问题讨论】:
-
tsc模板已更新为适用于所有 3.0 位。您需要通过tns create test --template tns-template-hello-world-ts@2.5专门指向 2.5 typescript 模板
标签: nativescript