1

Im trying to set up my machine for angular development following https://angular.io/docs/ts/latest/quickstart.html

I have come to the point where i have to run "npm start" to actually launch my site, but it seems like the typescript compilation fails.

tsc version: 3.10.8 node version: 6.6.0

> tsc

node_modules/@angular/common/src/localization.d.ts(4,1): error TS1128: Declaration or statement expected.
node_modules/@angular/common/src/localization.d.ts(4,16): error TS1005: ';' expected.
node_modules/@angular/common/src/localization.d.ts(4,25): error TS1005: ';' expected.
node_modules/@angular/common/src/localization.d.ts(5,14): error TS1005: '=' expected.
node_modules/@angular/common/src/localization.d.ts(5,37): error TS1005: ',' expected.
node_modules/@angular/common/src/localization.d.ts(5,43): error TS1005: ';' expected.
node_modules/@angular/common/src/location/location_strategy.d.ts(28,1): error TS1128: Declaration or statement expected.
node_modules/@angular/common/src/location/location_strategy.d.ts(28,16): error TS1005: ';' expected.
node_modules/@angular/common/src/location/location_strategy.d.ts(28,25): error TS1005: ';' expected.
node_modules/@angular/common/src/location/location_strategy.d.ts(29,14): error TS1005: '=' expected.
node_modules/@angular/common/src/location/location_strategy.d.ts(29,31): error TS1109: Expression expected.
node_modules/@angular/common/src/location/location_strategy.d.ts(29,41): error TS1005: ';' expected.
node_modules/@angular/common/src/location/location_strategy.d.ts(30,14): error TS1005: '=' expected.
node_modules/@angular/common/src/location/location_strategy.d.ts(30,41): error TS1005: ',' expected.
node_modules/@angular/common/src/location/location_strategy.d.ts(30,50): error TS1005: ';' expected.
node_modules/@angular/common/src/location/location_strategy.d.ts(31,14): error TS1005: '=' expected.
node_modules/@angular/common/src/location/location_strategy.d.ts(31,29): error TS1005: ',' expected.
node_modules/@angular/common/src/location/location_strategy.d.ts(31,41): error TS1005: ',' expected.
node_modules/@angular/common/src/location/location_strategy.d.ts(31,54): error TS1005: ',' expected.
node_modules/@angular/common/src/location/location_strategy.d.ts(31,75): error TS1005: ',' expected.
node_modules/@angular/common/src/location/location_strategy.d.ts(31,84): error TS1005: ';' expected.
node_modules/@angular/common/src/location/location_strategy.d.ts(32,14): error TS1005: '=' expected.
node_modules/@angular/common/src/location/location_strategy.d.ts(32,32): error TS1005: ',' expected.
node_modules/@angular/common/src/location/location_strategy.d.ts(32,44): error TS1005: ',' expected.
node_modules/@angular/common/src/location/location_strategy.d.ts(32,57): error TS1005: ',' expected.
node_modules/@angular/common/src/location/location_strategy.d.ts(32,78): error TS1005: ',' expected.
node_modules/@angular/common/src/location/location_strategy.d.ts(32,87): error TS1005: ';' expected.
node_modules/@angular/common/src/location/location_strategy.d.ts(33,14): error TS1005: '=' expected.
node_modules/@angular/common/src/location/location_strategy.d.ts(33,23): error TS1005: ';' expected.
node_modules/@angular/common/src/location/location_strategy.d.ts(34,14): error TS1005: '=' expected.
node_modules/@angular/common/src/location/location_strategy.d.ts(34,20): error TS1005: ';' expected.
node_modules/@angular/common/src/location/location_strategy.d.ts(35,14): error TS1005: '=' expected.
node_modules/@angular/common/src/location/location_strategy.d.ts(35,27): error TS1005: ',' expected.
node_modules/@angular/common/src/location/location_strategy.d.ts(35,52): error TS1005: ';' expected.
node_modules/@angular/common/src/location/location_strategy.d.ts(36,14): error TS1005: '=' expected.
node_modules/@angular/common/src/location/location_strategy.d.ts(36,27): error TS1005: ';' expected.
node_modules/@angular/common/src/location/platform_location.d.ts(34,1): error TS1128: Declaration or statement expected.
node_modules/@angular/common/src/location/platform_location.d.ts(34,16): error TS1005: ';' expected.
node_modules/@angular/common/src/location/platform_location.d.ts(34,25): error TS1005: ';' expected.
node_modules/@angular/common/src/location/platform_location.d.ts(35,14): error TS1005: '=' expected.
node_modules/@angular/common/src/location/platform_location.d.ts(35,34): error TS1005: ';' expected.
node_modules/@angular/common/src/location/platform_location.d.ts(36,14): error TS1005: '=' expected.
node_modules/@angular/common/src/location/platform_location.d.ts(36,27): error TS1005: ',' expected.
node_modules/@angular/common/src/location/platform_location.d.ts(36,52): error TS1005: ';' expected.
node_modules/@angular/common/src/location/platform_location.d.ts(37,14): error TS1005: '=' expected.

.... continues


node_modules/zone.js/lib/zone.ts(1110,89): error TS1134: Variable declaration expected.
/mnt/c/Users/mgj/Documents/makeitbro-angular2/node_modules/tsc/bin/tsc.js:11654
                node = node.parent;
                           ^

TypeError: Cannot read property 'parent' of undefined
    at appendOuterTypeParameters (/mnt/c/Users/mgj/Documents/makeitbro-angular2/node_modules/tsc/bin/tsc.js:11654:28)
    at getOuterTypeParametersOfClassOrInterface (/mnt/c/Users/mgj/Documents/makeitbro-angular2/node_modules/tsc/bin/tsc.js:11670:20)
    at getDeclaredTypeOfClassOrInterface (/mnt/c/Users/mgj/Documents/makeitbro-angular2/node_modules/tsc/bin/tsc.js:11807:43)
    at getDeclaredTypeOfSymbol (/mnt/c/Users/mgj/Documents/makeitbro-angular2/node_modules/tsc/bin/tsc.js:11876:24)
    at getTypeFromClassOrInterfaceReference (/mnt/c/Users/mgj/Documents/makeitbro-angular2/node_modules/tsc/bin/tsc.js:12579:24)
    at getTypeFromTypeReference (/mnt/c/Users/mgj/Documents/makeitbro-angular2/node_modules/tsc/bin/tsc.js:12631:48)
    at checkTypeReferenceNode (/mnt/c/Users/mgj/Documents/makeitbro-angular2/node_modules/tsc/bin/tsc.js:16757:24)
    at checkSourceElement (/mnt/c/Users/mgj/Documents/makeitbro-angular2/node_modules/tsc/bin/tsc.js:18585:28)
    at checkSignatureDeclaration (/mnt/c/Users/mgj/Documents/makeitbro-angular2/node_modules/tsc/bin/tsc.js:16575:21)
    at checkFunctionLikeDeclaration (/mnt/c/Users/mgj/Documents/makeitbro-angular2/node_modules/tsc/bin/tsc.js:17153:13)

npm ERR! Linux 3.4.0+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v6.6.0
npm ERR! npm  v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `tsc && concurrently "npm run tsc:w" "npm run lite" `
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'tsc && concurrently "npm run tsc:w" "npm run lite" '.
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 angular2-quickstart package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     tsc && concurrently "npm run tsc:w" "npm run lite"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs angular2-quickstart
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls angular2-quickstart
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /mnt/c/Users/mgj/Documents/makeitbro-angular2/npm-debug.log

My packages.json:

{
  "name": "angular2-quickstart",
  "version": "1.0.0",
  "scripts": {
    "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ",
    "lite": "lite-server",
    "postinstall": "typings install",
    "tsc": "tsc",
    "tsc:w": "tsc -w",
    "typings": "typings"
  },
  "license": "ISC",
  "dependencies": {
    "@angular/common": "2.0.0",
    "@angular/compiler": "2.0.0",
    "@angular/core": "2.0.0",
    "@angular/forms": "2.0.0",
    "@angular/http": "2.0.0",
    "@angular/platform-browser": "2.0.0",
    "@angular/platform-browser-dynamic": "2.0.0",
    "@angular/router": "3.0.0",
    "@angular/upgrade": "2.0.0",
    "core-js": "^2.4.1",
    "reflect-metadata": "^0.1.3",
    "rxjs": "5.0.0-beta.12",
    "systemjs": "0.19.27",
    "zone.js": "^0.6.23",
    "angular2-in-memory-web-api": "0.0.20",
    "bootstrap": "^3.3.6"
  },
  "devDependencies": {
    "concurrently": "^2.2.0",
    "lite-server": "^2.2.2",
    "typescript": "^2.0.2",
    "typings": "^1.3.2"
  }
}
2
  • Can you please share package,json? Commented Sep 17, 2016 at 7:20
  • What version of TypeScript is installed? Your question seems to suggest you have a version from the future as the TypeScript team is just now working on 2.0. Commented Sep 17, 2016 at 12:53

2 Answers 2

1

After npm install command you should have typings folder in your project.
If not try running npm install as administrator.

Sign up to request clarification or add additional context in comments.

4 Comments

I do indeed have a "typings" folder which contains a single, empty, file called "index.d.ts"
Also it should have folder globals with three folders inside : core-js, jasmine, node. Try deleting typings and node_modules folder and typing => npm install <= as administrator
It only contains index.d.ts. I have run npm install.
Have you added typings.json file?
0

You can install typings manually with this command:

npm run typings install

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.