2016-09-17 11 views
1

新しいRC7の角度でアプリケーションを起動しようとしていますが、コンソールが叫ぶと、Angular2 RC7への更新に失敗しました - zone.js&reflect-metadata

Promise rejection: Zone.assertZonePatched is not a function  angular2-polyfills.js:489 

、いつどういうわけか、このはこれがポップアップし、消える:

Reflect.getMetadata is not a function (..)        core.umd.js:472 

は、実装が変更のように見える、と私npm installがあちこちにすべてをエドが、鉱山が更新されませんm個のスクラッチ、次のように私のpackage.jsonを更新:

{ 
    "name": "angular2-quickstart", 
    "version": "1.0.0", 
    "scripts": { 
    "build": "webpack", 
    "start": "webpack-dev-server", 
    "typings": "typings", 
    "postinstall": "typings install" 
    }, 
    "license": "ISC", 
    "dependencies": { 
    "@angular/common": "2.0.0-rc.7", 
    "@angular/compiler": "2.0.0-rc.7", 
    "@angular/core": "2.0.0-rc.7", 
    "@angular/forms": "2.0.0-rc.7", 
    "@angular/http": "2.0.0-rc.7", 
    "@angular/platform-browser": "2.0.0-rc.7", 
    "@angular/platform-browser-dynamic": "2.0.0-rc.7", 
    "@angular/router": "3.0.0-rc.3", 
    "@angular/upgrade": "2.0.0-rc.7", 
    "core-js": "^2.4.1", 
    "reflect-metadata": "^0.1.3", 
    "rxjs": "5.0.0-beta.12", 
    "zone.js": "^0.6.21", 
    "angular2-in-memory-web-api": "0.0.19", 
    "@ng-bootstrap/ng-bootstrap": "^1.0.0-alpha.3", 
    "angular2": "2.0.0-beta.17", 
    "angular2-apollo": "^0.4.6", 
    "apollo-client": "^0.4.13", 
    "es6-promise": "^3.0.2", 
    "es6-shim": "^0.35.1", 
    "moment": "^2.14.1", 
    "source-map-loader": "^0.1.5" 
    }, 
    "devDependencies": { 
    "ts-loader": "^0.8.2" 
    } 
} 

のindex.html:(私も、パッケージのunpkg.comに参照のうえ何の成功を試していない)

<html> 

    <head> 
    <title>My App</title> 

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.3/css/bootstrap.min.css" 
      integrity="sha384-MIwDKRSSImVFAZCVLtU0LMDdON6KVCrZHyVQQj6e8wIEJkW4tvwqXrbMIya1vriY" crossorigin="anonymous"> 
    <link rel="stylesheet" href="style.css"> 

    <!-- 1. Load libraries --> 
    <!-- IE required polyfills, in this exact order --> 
    <script src="node_modules/es6-shim/es6-shim.min.js"></script> 

    <script src="https://www.atlasestateagents.co.uk/javascript/tether.min.js"></script> 
    <script src="https://code.jquery.com/jquery-3.1.0.min.js"></script> 
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.3/js/bootstrap.min.js" 
      integrity="sha384-ux8v3A6CPtOTqOzMKiuo3d/DomGaaClxFYdCu2HPMBEkf6x2xiDyJ7gkXU0MWwaD" crossorigin="anonymous"></script> 

    <script src="node_modules/core-js/client/shim.min.js"></script> 
    <script src="node_modules/zone.js/dist/zone.js"></script> 
    <script src="node_modules/reflect-metadata/Reflect.js"></script> 
    </head> 

    <!-- 3. Display the application --> 
    <body> 
    <my-app>Loading...</my-app> 
    </body> 

    <script src="node_modules/angular2/bundles/angular2-polyfills.js"></script> 
    <script src="dist/bundle.js"></script> 
</html> 

この問題を解決するためにどのように任意のアイデアを?

ありがとうございます! :)

+0

あなたの 'package.json'は' Angular2.0'バージョンに属しています。 – micronyks

+0

@micronyksどういう意味ですか? –

+0

Angular2.0(最近のリリースパッケージ)をインストールしています。RC7パッケージをお探しの場合は、http://stackoverflow.com/questions/39496055/which-angular-forms-version-for-angular-2- rc7/39496132#39496132ここで私はwebpackではなくsystemjsでRC7パッケージを見せています。 – micronyks

答えて

2

ノート

  • をpackage.jsonを1として、あなたはAngular2.0.0を使用しているあなたは、angular2-polyfills.jsに
  • 削除する必要はありません"angular2": "2.0.0-beta.17"package.json
  • あなたはnode_modules下angular2フォルダを持っている場合は、index.htmlを

    <script src="node_modules/angular2/bundles/angular2-polyfills.js"></script> 
    

Infactはからangular2-polyfills.jsを削除しますそのフォルダを削除します。最新のangle2パッケージは、@フォルダのノードモジュールの下にあります。

+0

あなたは基本的に私が依存関係私の 'packageからangular2。json'とちょうど再 - 'npm i'? (私の 'package.json'依存関係を-rc.7のものに更新しました) –

+0

そして、angular2パッケージはnode_modulesの下の@angularの中に存在しないようです: –

+0

node_modulesフォルダをきれいにしてから 'npm install'を実行すると、node_modulesの下に@angularの中にパッケージが置かれます。 – Sanket

関連する問題