【问题标题】:ASP.NET Core Angular template in Visual Studio 2017 fails to build with "SyntaxError: Unexpected token"Visual Studio 2017 中的 ASP.NET Core Angular 模板无法使用“SyntaxError: Unexpected token”构建
【发布时间】:2017-12-28 16:00:20
【问题描述】:

在 Visual Studio 2017(企业版)中使用 Angular ASP.NET Core Web 应用程序模板创建的新项目无法生成。到目前为止,我已经在两台机器上复制了这个。构建输出如下所示:

1>Performing first-run Webpack build...
1>C:\git\zoeri\zoeri-azure-graphs\samples\Zoeri.Azure.Graphs.Sample.Web\node_modules\webpack\bin\webpack.js:186
1>      outputOptions.children = options.map(o => o.stats);
1>                                             ^^
1>SyntaxError: Unexpected token =>
1>    at exports.runInThisContext (vm.js:73:16)
1>    at Module._compile (module.js:443:25)
1>    at Object.Module._extensions..js (module.js:478:10)
1>    at Module.load (module.js:355:32)
1>    at Function.Module._load (module.js:310:12)
1>    at Function.Module.runMain (module.js:501:10)
1>    at startup (node.js:129:16)
1>    at node.js:814:3
1>C:\git\zoeri\zoeri-azure-graphs\samples\Zoeri.Azure.Graphs.Sample.Web\Zoeri.Azure.Graphs.Sample.Web.csproj(33,5): error MSB3073: The command "node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js" exited with code 1.
1>Done building project "Zoeri.Azure.Graphs.Sample.Web.csproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

期待任何帮助!

【问题讨论】:

    标签: c# asp.net angularjs asp.net-core visual-studio-2017


    【解决方案1】:

    问题在于 ECMASCRIPT 版本,基本上是 JS 版本。 尝试使用最新的nodejs或4.5以上的node(需要使用'use strict';选项)

    ==> 是 ES6 中使用的新语法

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-02-22
      • 1970-01-01
      • 1970-01-01
      • 2017-12-06
      • 2016-04-09
      • 1970-01-01
      • 1970-01-01
      • 2017-05-30
      相关资源
      最近更新 更多