2017-12-04 3 views
0

コンポーネントを削除すると(nav-bar.component.tsとそのフォルダ)、アプリケーションがコンパイルできません。 app.module.tsから宣言を削除しました。スローされているエラーは、 "include.module.ts"と関係があり、nav-bar.component.tsとは関係がないと言います。ここでコンポーネントが削除されたときに角度付きアプリケーションがコンパイルされない

は、CLI出力である:

C:\Users\Daniel\dev-projects\vile>ng serve 
** NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ ** 
Date: 2017-12-04T17:02:37.587Z 
Hash: d00b13e972db5b32e6b8 
Time: 2988ms 
chunk {inline} inline.bundle.js, inline.bundle.js.map (inline) 5.83 kB [entry] [rendered] 
chunk {main} main.bundle.js, main.bundle.js.map (main) 1.06 kB {vendor} [initial] [rendered] 
chunk {polyfills} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 323 bytes {inline} [initial] [rendered] 
chunk {styles} styles.bundle.js, styles.bundle.js.map (styles) 56.5 kB {inline} [initial] [rendered] 
chunk {vendor} vendor.bundle.js, vendor.bundle.js.map (vendor) 338 kB [initial] [rendered] 

ERROR in Error: Metadata version mismatch for module C:/Users/Daniel/dev-projects/vile/node_modules/@angular/material/toolbar/typings/index.d.ts, found version 4, expected 3, resolving symbol IncludeModule in C:/Users/Daniel/dev-projects/vile/src/app/include/include.module.ts, resolving symbol IncludeModule in C:/Users/Daniel/dev-projects/vile/src/app/include/include.module.ts 
    at Error (native) 
    at syntaxError (C:\Users\Daniel\dev-projects\vile\node_modules\@angular\compiler\bundles\compiler.umd.js:1729:34) 
    at simplifyInContext (C:\Users\Daniel\dev-projects\vile\node_modules\@angular\compiler\bundles\compiler.umd.js:24979:23) 
    at StaticReflector.simplify (C:\Users\Daniel\dev-projects\vile\node_modules\@angular\compiler\bundles\compiler.umd.js:24991:13) 
    at StaticReflector.annotations (C:\Users\Daniel\dev-projects\vile\node_modules\@angular\compiler\bundles\compiler.umd.js:24418:41) 
    at _getNgModuleMetadata (C:\Users\Daniel\dev-projects\vile\node_modules\@angular\compiler-cli\src\ngtools_impl.js:138:31) 
    at _extractLazyRoutesFromStaticModule (C:\Users\Daniel\dev-projects\vile\node_modules\@angular\compiler-cli\src\ngtools_impl.js:109:26) 
    at C:\Users\Daniel\dev-projects\vile\node_modules\@angular\compiler-cli\src\ngtools_impl.js:129:27 
    at Array.reduce (native) 
    at _extractLazyRoutesFromStaticModule (C:\Users\Daniel\dev-projects\vile\node_modules\@angular\compiler-cli\src\ngtools_impl.js:128:10) 
    at Object.listLazyRoutesOfModule (C:\Users\Daniel\dev-projects\vile\node_modules\@angular\compiler-cli\src\ngtools_impl.js:53:22) 
    at Function.NgTools_InternalApi_NG_2.listLazyRoutes (C:\Users\Daniel\dev-projects\vile\node_modules\@angular\compiler-cli\src\ngtools_api.js:91:39) 
    at AotPlugin._getLazyRoutesFromNgtools (C:\Users\Daniel\dev-projects\vile\node_modules\@ngtools\webpack\src\plugin.js:207:44) 
    at _donePromise.Promise.resolve.then.then.then.then.then (C:\Users\Daniel\dev-projects\vile\node_modules\@ngtools\webpack\src\plugin.js:443:24) 
    at process._tickCallback (internal/process/next_tick.js:109:7) 

webpack: Failed to compile. 
+1

そのコンポーネントのファイルとフォルダを削除しましたが、他のファイルでそのパスを削除していない可能性があります。ある場合はチェックしてください。また、 'index.d.ts'ファイルのバージョンを確認し、v4ではなくv3を使用します。要するに、両方の場所で同じバージョンを保つ。 – MAC

+0

エラーは、@ angle/materialのv3の代わりにv4を使用していると言います。バージョンをv3に変更してnpm install –

答えて

0

私はこの問題を考え出しました。私は、nav-bar.module.tsにエクスポートされたinclude.module.ts(他のモジュールをインポートする私のモジュール)にモジュール( '@ angular/material/toolbar'のMatToolbarModule)をインポートしました。なんらかの理由で、MatToolbarModuleをエクスポートするinclude.module.tsに問題はないはずですが、コンパイルに失敗しました。私の単純な修正:MatToolbarModuleのimportステートメントを削除して、もう一度元に戻してください。

+0

を実行してください。あなたがangi-cliを使用している場合、ファイルをある程度追加/削除した場合、「ng server」を停止して再度実行する必要があります – Eliseo

関連する問題