Microsoft.AspNetCore.NodeServices:无法启动节点进程

编程入门 行业动态 更新时间:2024-10-27 03:37:40
本文介绍了Microsoft.AspNetCore.NodeServices:无法启动节点进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在ASP.Net Core应用程序中使用Microsoft.AspNetCore.NodeServices 1.1.1.一切正常,但是现在我在新计算机上,并出现以下错误:

I'm using Microsoft.AspNetCore.NodeServices 1.1.1 in my ASP.Net Core application. Everything has been working fine, but now I'm on a new computer and I get the following error:

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的目录.

I have removed the path variables from this question, but the directory where Node is installed is listed in there.

node -v给了我v6.11.0,所以它被添加到了路径中.

node -v in a terminal gives me v6.11.0 so it is added to the path.

自上次工作以来,代码中的任何内容都没有改变,只有我的计算机.有人知道什么地方可能出问题吗?

Nothing in the code has changed since it last worked, only my computer. Does anyone know what could be wrong?

推荐答案

调试后,我发现这是由于缺少文件夹造成的.

After debugging I found out that it was due to a missing folder.

这是在Startup.cs中配置NodeServices的方式:

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

一旦我添加了该路径,一切都会正常运行.

Once I added that path, everything runs okay.

更多推荐

Microsoft.AspNetCore.NodeServices:无法启动节点进程

本文发布于:2023-11-16 10:16:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1603384.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:节点   无法启动   进程   Microsoft   AspNetCore

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!