2017-06-19 98 views
1

我在我的ASP.Net核心应用程序中使用Microsoft.AspNetCore.NodeServices 1.1.1。一切都已经工作正常,但现在我在新电脑上,我得到以下错误:Microsoft.AspNetCore.NodeServices:无法启动节点进程

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 -v在终端给我v6.11.0所以它被添加到路径。

代码没有改变,因为它上次工作,只有我的电脑。有谁知道什么可能是错的?

回答

0

好吧,所以经过一些调试后,我发现这是由于缺少文件夹(以及一些误导性的错误信息)。

好的,所以这是由于我的新电脑上丢失的文件夹。只是有点误导性的错误:)

这是NodeServices是如何在Startup.cs配置:

services.AddNodeServices(options => 
{ 
    options.ProjectPath = "Path\That\Doesnt\Exist"; 
}); 

一旦我添加了路,一切运行正常。