2017-03-21 27 views
2

コーナーのアップグレードが必要なAngularアプリケーションにルータパッケージを追加した後、 、コモン、コンパイラなど)。特定のエラーコードは、多くの問題、node_modulesタイピングを削除し、それらを再作成されている主な解像度に私を導いたOBをグーグルでタイプスクリプトの型が壊れています(エラーTS2687): 'iterator'のすべての宣言に同じ修飾子を指定する必要があります

。私はそうしたが、同じ誤動作を経験する。

SOのところにはanother questionがありますが、それは古いですが、ほとんどのパッケージのさまざまなバージョンに関連しており、私の問題にどのように関連するのかほとんど分かりません。

正直、トラブルシューティングの方法が全くわからないので少し失礼です。以下は私のtsconfig.jsonです。 Webpack.common.jsで

編集

const path = require("path"); 
const HtmlWebpackPlugin = require("html-webpack-plugin"); 
const CopyWebpackPlugin = require("copy-webpack-plugin"); 

const distribution = path.resolve(__dirname, "distribution"); 
const application = path.resolve(__dirname, "source/application"); 
const resources = path.resolve(__dirname, "source/resources"); 

module.exports = { 
    entry: "./source/application/main.ts", 
    output: { 
    path: distribution, 
    filename: "bundle.js" 
    }, 
    module: { 
    loaders: [ 
     { test: /\.png$/, loader: "raw-loader", include: [resources] }, 
     { test: /\.s(a|c)ss$/, loaders: ["raw-loader", "sass-loader"] }, 
     { test: /\.html$/, loader: "raw-loader", include: [application] }, 
     { test: /\.ts$/, loader: "ts-loader", include: [application] }, 
    ] 
    }, 

    resolve: { 
    modules: ["node_modules", application], 
    extensions: [".js", ".ts"] 
    }, 

    performance: {}, 
    devtool: "source-map", 
    context: __dirname, 
    target: "web", 
    externals: [], 
    stats: {}, 

    devServer: { 
    contentBase: distribution, 
    port: 3002 
    }, 

    plugins: [ 
    new HtmlWebpackPlugin({ template: "./source/index.html" }), 
    new CopyWebpackPlugin([{ from: "./source/resources", to: "resources" }]) 
    ] 
} 
+0

を真のラインデバッグ=を削除し、以下のコードを変更:\プログラムファイルを\ nodejs –

+0

@VenkateswaranR正確な設定はどうすればいいですか?そして私はそれを何に設定するのですか? –

+0

Visual Studioのツールバーのツール - >オプション - >プロジェクトとソリューション--->外部WebツールとC:\ Program Files \ nodejsを最初に設定します。 –

答えて

0

外部WebツールCにパスを追加

module.exports = { 
    entry: { 
     'polyfills': './src/polyfills.ts', 
     'vendor': './src/vendor.ts', 
     'app': './src/main.ts' 
    }, 

    resolve: { 
     extensions: ['*', '.js', '.ts'] 
    }, 

    module: { 
     rules: [ 
]}, 
plugins: [ 
     new webpack.ContextReplacementPlugin(
      // The (\\|\/) piece accounts for path separators in *nix and Windows 
      /angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/, 
      helpers.root('./src'), // location of your src 
      {} // a map of your routes 
     ), 

     new webpack.optimize.CommonsChunkPlugin({ 
      name: ['app', 'vendor', 'polyfills'] 
     }), 
+0

Typescript 2の場合は、入力を使用するか、 '@ types/node'、 '@ types/jasmine'、 '@ types/core-js'のような開発者の依存性の下に含めることができます –

+0

私は望んでいませんでした私の* webfig.js *でフォーラムを汚染していますが、私はそうしなければならないようです。編集をご覧ください。それはあなたのものと事実上同じです。エラーの原因がどこにあるのかはわかりません。 –

関連する問題