我创建了一个自定义模板。我还没有在Github或任何其他平台上托管它。 模板现在位于本地计算机中。
路径:C:\Users\dumyUserName\Documents\nativescript\templates\template1
此模板中的内容具有此文件夹结构
-App_Resources
-hooks
-src
-- app
--- assets
--- common
--- directives
--- models
--- components
--- pipes
--- services
--- shared
--- app.component.html
--- app.component.ts
--- app.module.ts
--- app-routing.module.ts
-- fonts
-- _app-common.scss
-- _app-variables.scss
-- app.android.scss
-- app.ios.scss
-- main.ts
-- package.json
当我尝试使用以下命令创建新项目时
tns create myApp --template C:\Users\dumyUserName\Documents\nativescript\templates\template1
我收到以下错误
Command npm.cmd failed with exit code 1
# tns create
### Arguments
<App Name> is the name of project and must meet the requirements of each platform that you want to target.
If not specified in the initial command, the NativeScript CLI will ask you for it afterwards.
For more information about the <App Name> requirements, run $ tns help create.
Package.json
{
"nativescript": {
"id": "org.abcd.blank",
"tns-ios": {
"version": "6.0.2"
},
"tns-android": {
"version": "6.0.2"
}
},
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"repository": "<fill-your-repository-here>",
"dependencies": {
"@angular/animations": "~8.2.0",
"@angular/common": "~8.2.0",
"@angular/compiler": "~8.2.0",
"@angular/core": "~8.2.0",
"@angular/forms": "~8.2.0",
"@angular/platform-browser": "~8.2.0",
"@angular/platform-browser-dynamic": "~8.2.0",
"@angular/router": "~8.2.0",
"nativescript-angular": "~8.2.0",
"nativescript-theme-core": "~1.0.6",
"reflect-metadata": "~0.1.12",
"rxjs": "^6.4.0",
"tns-core-modules": "~6.0.0",
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular/cli": "^8.3.12",
"@angular/compiler-cli": "~8.2.0",
"@nativescript/schematics": "^0.7.2",
"@ngtools/webpack": "~8.2.0",
"nativescript-dev-webpack": "~1.1.0",
"node-sass": "^4.12.0",
"typescript": "~3.5.3"
},
"gitHead": "44f4a6a9c94eaf9c68d2a41e0dbbb1a2544bc28f",
"readme": "NativeScript Application"
}