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
- Original URL
- State: open
- Created 6 years ago
- Comments: 24
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 usingnpm install -g windows-build-toolsas an alternative.Install node-gyp globally:
npm install -g node-gypThen try installing the package again:
npm install robotjsThis solved the issue for me.
Finally, after 2 years I found a solution that works for me:
npm install -g windows-build-toolsinstead ofnpm install --global --production windows-build-toolsAnother thing you can try is to install node-gyp locally as a development dependency
npm i robotjsworks for me after that (remember to run as administrator) whereas it doesn’t work with node-gyp installed globally for some reasonFor 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