2017-06-19 93 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"; 
}); 

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