Reputation: 865
I downloaded an Angular 2 example from the official website, ran npm install, then npm start.
But npm start is giving me error.
I am using windows powershell (because ubuntu doesn't let me update to npm 4.3.0).
I have typescript version 2.2.1,
npm version 4.4.0,
node version 7.7.1.
This is the error I am getting
Any help is appreciated
src/app/header.component.ts(5,32): error TS1005: ',' expected.
src/app/header.component.ts(5,33): error TS1002: Unterminated string literal.
src/app/header.component.ts(7,1): error TS1005: ':' expected.
src/app/header.component.ts(8,20): error TS1005: '{' expected.
src/app/header.component.ts(8,22): error TS1005: '=>' expected.
src/app/prescription.components.ts(5,32): error TS1002: Unterminated string literal.
src/app/prescription.components.ts(6,6): error TS1005: ',' expected.
src/app/prescription.components.ts(7,15): error TS1161: Unterminated regular expression literal
src/app/prescription.components.ts(8,17): error TS1161: Unterminated regular expression literal
src/app/prescription.components.ts(9,16): error TS1161: Unterminated regular expression literal
src/app/prescription.components.ts(10,4): error TS1161: Unterminated regular expression literal
src/app/prescription.components.ts(11,19): error TS1005: ',' expected.
src/app/prescription.components.ts(11,40): error TS1005: '{' expected.
src/app/prescription.components.ts(11,55): error TS1005: ':' expected.
src/app/prescription.components.ts(12,10): error TS1005: '>' expected.
src/app/prescription.components.ts(12,13): error TS1005: ',' expected.
src/app/prescription.components.ts(12,25): error TS1005: ':' expected.
src/app/prescription.components.ts(13,8): error TS1005: '>' expected.
src/app/prescription.components.ts(13,14): error TS1005: ',' expected.
src/app/prescription.components.ts(13,35): error TS1005: ':' expected.
src/app/prescription.components.ts(14,9): error TS1005: '>' expected.
src/app/prescription.components.ts(14,24): error TS1005: ',' expected.
src/app/prescription.components.ts(14,31): error TS1005: ':' expected.
src/app/prescription.components.ts(14,33): error TS1136: Property assignment expected.
src/app/prescription.components.ts(14,38): error TS1005: ':' expected.
src/app/prescription.components.ts(14,44): error TS1005: ',' expected.
src/app/prescription.components.ts(14,46): error TS1110: Type expected.
src/app/prescription.components.ts(14,47): error TS1161: Unterminated regular expression litera
src/app/prescription.components.ts(15,9): error TS1005: ',' expected.
src/app/prescription.components.ts(15,33): error TS1136: Property assignment expected.
src/app/prescription.components.ts(15,38): error TS1005: ':' expected.
src/app/prescription.components.ts(15,46): error TS1005: ',' expected.
src/app/prescription.components.ts(15,48): error TS1110: Type expected.
src/app/prescription.components.ts(15,49): error TS1161: Unterminated regular expression litera
src/app/prescription.components.ts(16,9): error TS1005: ',' expected.
src/app/prescription.components.ts(16,33): error TS1136: Property assignment expected.
src/app/prescription.components.ts(16,38): error TS1005: ':' expected.
src/app/prescription.components.ts(16,45): error TS1005: ',' expected.
src/app/prescription.components.ts(16,47): error TS1110: Type expected.
src/app/prescription.components.ts(16,48): error TS1161: Unterminated regular expression litera
src/app/prescription.components.ts(17,6): error TS1161: Unterminated regular expression literal
src/app/prescription.components.ts(18,5): error TS1161: Unterminated regular expression literal
src/app/prescription.components.ts(19,1): error TS1005: ',' expected.
src/app/prescription.components.ts(30,26): error TS1005: '{' expected.
src/app/prescription.components.ts(31,6): error TS1005: ':' expected.
src/app/prescription.components.ts(31,37): error TS1005: ',' expected.
src/app/prescription.components.ts(32,25): error TS1005: ',' expected.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: `tsc -p src/`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] 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! A complete log of this run can be found in:
npm ERR! C:\Users\Reimu\AppData\Roaming\npm-cache\_logs\2017-03-04T20_10_10_067Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] prestart: `npm run build`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] 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! A complete log of this run can be found in:
npm ERR! C:\Users\Reimu\AppData\Roaming\npm-cache\_logs\2017-03-04T20_10_10_213Z-debug.log
UPDATE: package.json
{
"name": "angular-quickstart",
"version": "1.0.0",
"description": "QuickStart package.json from the documentation, supplemented with testing support",
"scripts": {
"build": "tsc -p src/",
"build:watch": "tsc -p src/ -w",
"build:e2e": "tsc -p e2e/",
"serve": "lite-server -c=bs-config.json",
"serve:e2e": "lite-server -c=bs-config.e2e.json",
"prestart": "npm run build",
"start": "concurrently \"npm run build:watch\" \"npm run serve\"",
"pree2e": "npm run build:e2e",
"e2e": "concurrently \"npm run serve:e2e\" \"npm run protractor\" --kill-others --success first",
"preprotractor": "webdriver-manager update",
"protractor": "protractor protractor.config.js",
"pretest": "npm run build",
"test": "concurrently \"npm run build:watch\" \"karma start karma.conf.js\"",
"pretest:once": "npm run build",
"test:once": "karma start karma.conf.js --single-run",
"lint": "tslint ./src/**/*.ts -t verbose"
},
"keywords": [],
"author": "",
"license": "MIT",
"dependencies": {
"@angular/common": "~2.4.0",
"@angular/compiler": "~2.4.0",
"@angular/core": "~2.4.0",
"@angular/forms": "~2.4.0",
"@angular/http": "~2.4.0",
"@angular/platform-browser": "~2.4.0",
"@angular/platform-browser-dynamic": "~2.4.0",
"@angular/router": "~3.4.0",
"angular-in-memory-web-api": "~0.2.4",
"systemjs": "0.19.40",
"core-js": "^2.4.1",
"rxjs": "5.0.1",
"zone.js": "^0.7.4"
},
"devDependencies": {
"concurrently": "^3.2.0",
"lite-server": "^2.2.2",
"typescript": "~2.0.10",
"canonical-path": "0.0.2",
"tslint": "^3.15.1",
"lodash": "^4.16.4",
"jasmine-core": "~2.4.1",
"karma": "^1.3.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~4.0.14",
"rimraf": "^2.5.4",
"@types/node": "^6.0.46",
"@types/jasmine": "2.5.36"
},
"repository": {}
}
Upvotes: 0
Views: 4802
Reputation: 267
If you really try
npm install
npm build
npm start
and this message still appear, could you please tell us what is the last thing you wrote in your type script files.
Did you really get the code from here ? If yes, I did the following from node.js command prompt and worked as magic:
cd C:\..<your path>
npm install
npm build
npm start
Upvotes: 1