简体   繁体   中英

Angular2 QuickStart refuse to build for release candidate

I'm trying to walk through the quickstart for Angular2 now when the release candidate is out. However, the typescript compiler throws a lot of errors that I can't figure out.

https://angular.io/guide/quickstart

First a lot of lines like this. node_modules/@angular/core/src/application_ref.d.ts(39,88): error TS2304: Cannot find name 'Promise'. node_modules/@angular/core/src/application_ref.d.ts(99,42): error TS2304: Cannot find name 'Promise'.

and then this... npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "tsc" npm ERR! node v0.12.2 npm ERR! npm v2.7.4 npm ERR! code ELIFECYCLE npm ERR! angular2-quickstart@1.0.0 tsc: tsc npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the angular2-quickstart@1.0.0 tsc script 'tsc'. npm ERR! 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 npm ERR! 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! C:\\Development\\Angular2RCQuickstart\\npm-debug.log

Anyone out there that knows what's wrong?

Easy dirty fix

Copy the typings folder from Angular 2 beta 17 into @angular project so ///<reference path="node_modules/angular2/typings/browser.d.ts"/> in your top level component works again

Clean fix

You have to manualy install the typings for ES6 promise and ES6 collections with typings install es6-promise use the --ambient flag for tsd (deprecated) typings.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM