加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net-core – Microsoft.AspNetCore.NodeServices:无法启动

发布时间:2020-12-16 06:50:46 所属栏目:asp.Net 来源:网络整理
导读:我在我的ASP.Net Core应用程序中使用Microsoft.AspNetCore.NodeServices 1.1.1.一切都工作正常,但现在我在一台新电脑上,我收到以下错误: System.InvalidOperationException:Failed to start Node process. To resolve this:.[1] Ensure that Node.js is ins
我在我的ASP.Net Core应用程序中使用Microsoft.AspNetCore.NodeServices 1.1.1.一切都工作正常,但现在我在一台新电脑上,我收到以下错误:

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,所以它被添加到路径中.

代码中的任何内容都没有改变,因为它上次工作,只有我的电脑.有谁知道什么可能是错的?

解决方法

调试后我发现它是由于丢失文件夹.

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

services.AddNodeServices(options =>
{
    options.ProjectPath = "PathThatDoesntExist";
});

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读