我在用着Microsoft.AspNetCore.NodeServices 1.1.1
在我的 ASP.Net Core 应用程序中。一切都工作正常,但现在我在一台新计算机上,出现以下错误:
System.InvalidOperationException:
Failed to start Node process. To resolve this:.
[1] Ensure that Node.js is installed and can be found in one of the PATH directories.
Current PATH enviroment variable is: ....
Make sure the Node executable is in one of those directories, or update your PATH.
[2] See the InnerException for further details of the cause.
我已经从这个问题中删除了路径变量,但安装 Node 的目录列在其中。
node -v
在终端给我v6.11.0
所以它被添加到路径中。
自上次运行以来,代码中的任何内容都没有发生变化,只有我的计算机发生了变化。有谁知道可能出了什么问题?
经过调试发现是因为缺少文件夹造成的。
就是这样NodeServices
配置于Startup.cs
:
services.AddNodeServices(options =>
{
options.ProjectPath = "Path\That\Doesnt\Exist";
});
一旦我添加了这条路径,一切就正常了。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)