octalmage / robotjs

Node.js Desktop Automation.
http://robotjs.io
MIT License
12.37k stars 961 forks source link

Windows 10 - Could not open main display #582

Open N1ghtTheF0x opened 4 years ago

N1ghtTheF0x commented 4 years ago

Expected Behavior

To move the mouse cursor to a specific location and key input

Current Behavior

in the console:

Could not open main display (npm Error log) 2020-05-25T15_20_19_061Z-debug.log

Possible Solution

I looked through some closed issues but I did everything they said there and nothing changed

Steps to Reproduce (for bugs)

  1. install robotjs via npm
  2. const robotjs = require('robotjs')
    robotjs.moveMouse(80,100) // should move the mouse
    robotjs.keyTap("f11") // should press the key F11

    Context

    I wanted to create something like this in JavaScript but this is the only thing missing

    Your Environment

    • RobotJS version: 0.6.0
    • Node.js version: 14.3.0
    • npm version: 6.14.5
    • Operating System: Windows 10 Pro 1836.836
narajaon commented 4 years ago

same problem here, I'm using the readme's example and get

Could not open main display
Segmentation fault (core dumped)