失败:没有PlatformRef提供程序的Microsoft.AspNetCore.NodeServices [0]!错误

时间:2018-02-23 08:44:46

标签: node.js angular visual-studio webpack asp.net-core

我开发了一个带有Angular 4的ASP.NET Core 2.0应用程序,我试图将其更新为Angular 5。

要进行更新,我已按照本教程Upgrade Angular 4 app to Angular 5 with Visual Studio 2017进行了操作。

但是当我使用节点运行应用程序时,我收到以下消息:

info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
      User profile is available. Using 'C:\Users\Uic18.IC.000\AppData\Local\ASP.
NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at
rest.
Hosting environment: Development
Content root path: D:\Desarrollo\MyApp\AngularWebApplic
ation\AngularWebApplication
Now listening on: http://localhost:50356
Application started. Press Ctrl+C to shut down.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://localhost:50356/
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1]
      Executing action method AngularWebApplication.Controllers.HomeController.I
ndex (AngularWebApplication) with arguments ((null)) - ModelState is Valid
info: Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.ViewResultExecutor[1]
      Executing ViewResult, running view at path /Views/Home/Index.cshtml.
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2]
      Executed action AngularWebApplication.Controllers.HomeController.Index (An
gularWebApplication) in 3819.9801ms
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 4181.4943ms 200 text/html; charset=utf-8
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://localhost:50356/dist/main-client.js?v
=8SjbzGJ0XAUj8-zoVkv-_b_lOUJstsV6wmYaawCZjd4
info: Microsoft.AspNetCore.NodeServices[0]
      webpack built 87cdc734d642ca666961 in 10958ms
fail: Microsoft.AspNetCore.NodeServices[0]
      Hash: 87cdc734d642ca666961
      Version: webpack 3.11.0
      Time: 10958ms
                   Asset     Size  Chunks                    Chunk Names
          main-client.js  4.12 MB       0  [emitted]  [big]  main-client
      main-client.js.map  5.07 MB       0  [emitted]         main-client
         [0] ./node_modules/@angular/core/esm5/core.js 628 kB {0} [built]
        [79] multi event-source-polyfill webpack-hot-middleware/client?path=__we
bpack_hmr&dynamicPublicPath=true ./ClientApp/boot.browser.ts 52 bytes {0} [built
]
        [80] ./node_modules/event-source-polyfill/src/eventsource.js 21.4 kB {0}
 [built]
        [81] (webpack)-hot-middleware/client.js?path=__webpack_hmr&dynamicPublic
Path=true 7.35 kB {0} [built]
        [82] (webpack)/buildin/module.js 517 bytes {0} [built]
        [83] ./node_modules/querystring-es3/index.js 127 bytes {0} [built]
        [86] ./node_modules/strip-ansi/index.js 161 bytes {0} [built]
        [88] (webpack)-hot-middleware/client-overlay.js 2.21 kB {0} [built]
        [93] (webpack)-hot-middleware/process-update.js 4.33 kB {0} [built]
        [94] ./ClientApp/boot.browser.ts 1.01 kB {0} [built]
        [95] ./ClientApp/polyfills.ts 2.54 kB {0} [built]
       [148] ./node_modules/reflect-metadata/Reflect.js 52.3 kB {0} [built]
       [150] ./node_modules/bootstrap/dist/js/bootstrap.js 115 kB {0} [built]
       [156] ./node_modules/@angular/platform-browser-dynamic/esm5/platform-brow
ser-dynamic.js 24.8 kB {0} [built]
       [158] ./ClientApp/app/app.module.browser.ts 1.49 kB {0} [built]
          + 246 hidden modules

      WARNING in ./node_modules/@angular/core/esm5/core.js
      6558:15-36 Critical dependency: the request of a dependency is an expressi
on
       @ ./node_modules/@angular/core/esm5/core.js
       @ ./ClientApp/boot.browser.ts
       @ multi event-source-polyfill webpack-hot-middleware/client?path=__webpac
k_hmr&dynamicPublicPath=true ./ClientApp/boot.browser.ts

      WARNING in ./node_modules/@angular/core/esm5/core.js
      6578:15-102 Critical dependency: the request of a dependency is an express
ion
       @ ./node_modules/@angular/core/esm5/core.js
       @ ./ClientApp/boot.browser.ts
       @ multi event-source-polyfill webpack-hot-middleware/client?path=__webpac
k_hmr&dynamicPublicPath=true ./ClientApp/boot.browser.ts
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 4074.9028ms 200 application/javascript; charset=UTF-8
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://localhost:50356/dist/__webpack_hmr

我只在浏览器中看到一条文字说:正在加载......

有一条消息fail: Microsoft.AspNetCore.NodeServices[0],但没有别的。

如果我将Views/Home/Index.cshtml文件中的更改从<app>Loading...</app>回滚到<app asp-prerender-module="ClientApp/dist/main-server">Loading...</app>,我会收到另一个错误:

NodeInvocationException: No provider for PlatformRef!
Error: No provider for PlatformRef!
at Error (native)

要解决这个问题,我已经遵循了这个SO Answer而没有成功。

关于如何解决这个问题的任何想法?

0 个答案:

没有答案