I've been trying to learn NativeScript through a tutorial, but I keep encountering errors.
Here is an excerpt from my app.component.ts file:
import { Component } from '@angular/core';
@Component ({
selector: 'my-app',
template: '
<ul>
<li><a [routerLink] = "['/Product']">Product</a></li>
<li><a [routerLink] = "['/Inventory']">Inventory</a></li>
</ul>
<router-outlet></router-outlet>'
})
export class AppComponent { }
In the TypeScript plugin of Atom, when I hover over the template:
, it indicates that the type is (property) template: boolean
, which seems strange. If I try to condense the HTML onto a single line, it recognizes it as a string type, suggesting that it may not support multiple lines for the template property.
As a beginner in NativeScript, I just want to move forward with the tutorial and fix any issues. I have carefully checked the code provided in the tutorial, but I can't spot the error. Below is the error message I encounter when attempting to run the application:
$ npm start
> <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="21404f46544d40530c505448424a525540535561100f110f11">[email protected]</a> prestart /Users/mb102/Angular-Projects/Demo
> npm run build
> <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e3828d84968f8291ce92968a80889097829197a3d2cdd3cdd3">[email protected]</a> build /Users/mb102/Angular-Projects/Demo
> tsc -p src/
src/app/app.component.ts(5,15): error TS1002: Unterminated string literal.
src/app/app.component.ts(7,27): error TS1005: '>' expected.
src/app/app.component.ts(7,43): error TS1005: ':' expected.
src/app/app.component.ts(8,27): error TS1005: '>' expected.
src/app/app.component.ts(8,45): error TS1005: ':' expected.
src/app/app.component.ts(9,5): error TS1110: Type expected.
src/app/app.component.ts(9,6): error TS1161: Unterminated regular expression literal.
src/app/app.component.ts(10,20): error TS1110: Type expected.
src/app/app.component.ts(10,21): error TS1161: Unterminated regular expression literal.
npm ERR! Darwin 16.7.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="33525d54465f52411e42465a5058404752414773021d031d03">[email protected]</a> build: `tsc -p src/`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6908070e1c05081b44181c000a021a1d081b1d295847594759">[email protected]</a> build script 'tsc -p src/'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the angular-quickstart package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! tsc -p src/
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular-quickstart
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls angular-quickstart
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/mb102/Angular-Projects/Demo/npm-debug.log
npm ERR! Darwin 16.7.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="13727d74667f72613e62667a7078606772616753223d233d23">[email protected]</a> prestart: `npm run build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f6979891839a9784db87839f959d8582978482b6c7d8c6d8c6">[email protected]</a> prestart script 'npm run build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the angular-quickstart package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular-quickstart
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls angular-quickstart
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/mb102/Angular-Projects/Demo/npm-debug.log