【问题标题】:Spawn Rscript ENOENT error while running R script in NodeJS在 NodeJS 中运行 R 脚本时产生 Rscript ENOENT 错误
【发布时间】:2020-07-11 16:11:38
【问题描述】:

index.js 文件

R("message.R")
.data("hello world", 20)
.call(function(err, d) {
     if (err) console.log('err:', err);
     console.log('hiiii:', d);
   });

message.R 文件

Print('ankit is here')

在命令行中,当运行node index.js,得到错误 spawn Rscript ENOENT

events.js:174 投掷者; // 未处理的“错误”事件 ^

错误:生成 Rscript ENOENT 在 Process.ChildProcess._handle.onexit (internal/child_process.js:240:19) 在 onErrorNT (internal/child_process.js:415:16) 在 process._tickCallback (internal/process/next_tick.js:63:19) 在 Function.Module.runMain (internal/modules/cjs/loader.js:834:11) 启动时(内部/bootstrap/node.js:283:19) 在 bootstrapNodeJSCore (internal/bootstrap/node.js:623:3) 在以下位置发出“错误”事件: 在 Process.ChildProcess._handle.onexit (internal/child_process.js:246:12) 在 onErrorNT (internal/child_process.js:415:16) [...与原始堆栈跟踪匹配的行...] 在 bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

【问题讨论】:

    标签: node.js express rscript


    【解决方案1】:

    如果您也遇到同样的问题,在花费 4-5 小时后,我知道我们需要在您的本地机器上安装 R。安装R的过程如链接中所述。install R in ubuntu

    在输入 R 之后, 你会得到R环境

    安装

    install.packages("dplyr");
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-08-22
      • 2018-07-15
      • 1970-01-01
      • 2016-10-02
      • 1970-01-01
      • 2013-07-30
      相关资源
      最近更新 更多