创建NativeScript和Angular应用程序模板时出现挂钩问题

创建NativeScript和Angular应用程序模板时出现挂钩问题,nativescript,angular2-nativescript,Nativescript,Angular2 Nativescript,我正在尝试创建一个新模板,用于使用Angular 2创建新的NativeScript应用程序,非常类似 问题是:无论出于什么原因,在我使用模板创建新应用程序之后,我最终得到了两个挂钩文件夹,一个在根文件夹中,另一个在app/中。roothooks很酷,但是app/hooks/before livesync/nativescript angular sync.js在我尝试运行从模板创建的应用程序时会导致类型脚本问题 所以我的问题是:app/hooks为什么存在?当我使用tns create tes

我正在尝试创建一个新模板,用于使用Angular 2创建新的NativeScript应用程序,非常类似

问题是:无论出于什么原因,在我使用模板创建新应用程序之后,我最终得到了两个
挂钩
文件夹,一个在根文件夹中,另一个在
app/
中。root
hooks
很酷,但是
app/hooks/before livesync/nativescript angular sync.js
在我尝试运行从模板创建的应用程序时会导致类型脚本问题

所以我的问题是:
app/hooks
为什么存在?当我使用
tns create test--ng(使用)创建应用程序时,它不起作用。我在下面使用了完整的
包.json
。任何帮助都将不胜感激

{
  "name": "tns-template-tutorial-ng",
  "version": "1.0.0",
  "description": "A template for the NativeScript & Angular tutorial on nativescript.org",
  "repository": {
    "type": "git",
    "url": "https://github.com/nativescript/tns-template-tutorial-ng.git"
  },
  "keywords": [
    "NativeScript"
  ],
  "author": "Telerik <support@telerik.com>",
  "license": "Apache-2.0",
  "bugs": {
    "url": "https://github.com/nativescript/tns-template-tutorial-ng/issues"
  },
  "homepage": "https://github.com/nativescript/tns-template-tutorial-ng/groceries",
  "dependencies": {
    "@angular/common": "2.1.2",
    "@angular/compiler": "2.1.2",
    "@angular/core": "2.1.2",
    "@angular/http": "2.1.2",
    "@angular/platform-browser": "2.1.2",
    "@angular/platform-browser-dynamic": "2.1.2",
    "@angular/platform-server": "2.1.2",
    "@angular/router": "3.1.2",
    "nativescript-angular": "1.1.2",
    "reflect-metadata": "0.1.8",
    "rxjs": "5.0.0-beta.12",
    "tns-core-modules": "2.4.2"
  },
  "devDependencies": {
    "nativescript-dev-typescript": "^0.3.2",
    "nativescript-dev-android-snapshot": "^0.*.*",
    "typescript": "^2.0.10",
    "zone.js": "0.6.21"
  }
}
{
“名称”:“tns模板教程ng”,
“版本”:“1.0.0”,
“说明”:“NativeScript.org上NativeScript和Angular教程的模板”,
“存储库”:{
“类型”:“git”,
“url”:”https://github.com/nativescript/tns-template-tutorial-ng.git"
},
“关键词”:[
“NativeScript”
],
“author”:“Telerik”,
“许可证”:“Apache-2.0”,
“臭虫”:{
“url”:”https://github.com/nativescript/tns-template-tutorial-ng/issues"
},
“主页”:https://github.com/nativescript/tns-template-tutorial-ng/groceries",
“依赖项”:{
“@angular/common”:“2.1.2”,
“@angular/compiler”:“2.1.2”,
“@angular/core”:“2.1.2”,
“@angular/http”:“2.1.2”,
“@角度/平台浏览器”:“2.1.2”,
“@angular/platform browser dynamic”:“2.1.2”,
“@angular/platform服务器”:“2.1.2”,
“@angular/router”:“3.1.2”,
“nativescript angular”:“1.1.2”,
“反映元数据”:“0.1.8”,
“rxjs”:“5.0.0-beta.12”,
“tns核心模块”:“2.4.2”
},
“依赖性”:{
“nativescript开发人员类型脚本”:“^0.3.2”,
“nativescript开发人员android快照”:“^0.*.”,
“类型脚本”:“^2.0.10”,
“zone.js”:“0.6.21”
}
}

这是因为TNS命令在提取模板时的行为方式会再次(不正确地)应用某些操作

有关此问题的讨论,请参见:的顶部部分。关于删除/保留安装后脚本的讨论不幸地掩盖了这个问题。但实际的潜在问题是因为TNS在安装模板时做了一些奇怪的事情,破坏了一些东西