在csproj中定义AspNetCoreHostingModel会引发无法启动“ npm”异常

时间:2018-12-09 20:33:41

标签: asp.net-core

ASP.NET Core 2.2更新具有此新的AspNetCoreHostingModel属性,可以将其设置为InProcessOutOfProccess。如果我将属性添加到csproj中,而与设置哪个选项都没有关系,则会出现以下错误:

AggregateException: One or more errors occurred. (One or more errors occurred. (Failed to start 'npm'. To resolve this:
[1] Ensure that 'npm' is installed and can be found in one of the PATH directories.
Current PATH enviroment variable is: (there are some 20 paths before this last one);C:\Program Files\nodejs;
Make sure the executable is in one of those directories, or update your PATH.

npm的路径已经在此处说明了,那么还有什么问题呢?

1 个答案:

答案 0 :(得分:3)

我在PropertyGroup中添加了“ AspNetCoreModule”,并且可以正常工作。

services:
  App\Security\wsseProvider:
    autowire: true
    public: false

参考:https://blogs.msdn.microsoft.com/webdev/2018/12/04/asp-net-core-2-2-available-today/