robotjs: error installing with npm in windows 10

npm i robotjs don’t work not install in windows 10

Possible Solution

not idea

Context

Your Environment

  • RobotJS version: npm version last
  • Node.js version: 8.11.2
  • npm version: 5.6.0
  • Operating System: Windows 10 Home 64x

About this issue

Most upvoted comments

It might be worth updating Node before doing the instructions below.

Run this command from an administrative shell to install the “software” dependencias (Visual Studio, Python) on windows: npm install --global --production windows-build-tools, recent feedback has been using npm install -g windows-build-tools as an alternative.

Install node-gyp globally: npm install -g node-gyp

Then try installing the package again: npm install robotjs

This solved the issue for me.

Finally, after 2 years I found a solution that works for me: npm install -g windows-build-tools instead of npm install --global --production windows-build-tools

Another thing you can try is to install node-gyp locally as a development dependency

npm i --save-dev node-gyp

npm i robotjs works for me after that (remember to run as administrator) whereas it doesn’t work with node-gyp installed globally for some reason

For the people who can’t install robotjs because of node-gyp, I’ve been able to fix it by downloading node version 10. The person who told me this way of fixing it, told me that the npm install for this libary uses a file that is nolonger included in node version 12, for this reason downloading an older version seems to fix it. I can’t remember the source so sorry for that.

@lucasctd I had the same error the method above worked for me but I would check your node version first before trying it.

ps: I did this for windows, I have no clue if this will work for other systems.

it worked, after I install a newer nodejs 8.11.3