我是NodeJS的新手,我正在运行一个微服务,我想在没有浏览器的情况下打开网页,以每20秒发出一次客户端api请求。我正在尝试使用包openurl
const openPage = require("openurl");
function openUpPage(url){
openPage.open(url);
}
setInterval(function() { openUpPage("myURl") }, 20000);
但是我现在不断收到错误消息:
events.js:183
throw er; // Unhandled 'error' event
Error: spawn xdg-open ENOENT
at _errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (
internal/child_process.js:190:19)
at onErrorNT (internal/child_process.js:372:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)