octalmage / robotjs

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

Cannot install/build robotjs: "gyp: Call to 'node -e "require('nan')"' returned exit status 1 while in binding.gyp" #690

Closed dotnetdan closed 2 years ago

dotnetdan commented 2 years ago

I cannot successfully install/build this package, using Windows 10. I get errors related to 'nan'. I don't know what else I can do, any help would be appreciated.

I have all prerequisites installed and configured for node-gyp as per the documentation :

I am able to build other packages that require node-gyp, such as sqlite3

Expected Behavior

To use npm install robotjs successfully

Current Behavior

Both commands

npm install robotjs node-gyp rebuild

result in the same error:

Error: Cannot find module 'nan' Require stack:

Steps to Reproduce (for bugs)

  1. npm init
  2. npm install robotjs (nan error occurs)
  3. node-gyp rebuild (same nan error occurs)

Your Environment

dotnetdan commented 2 years ago

I finally solved this issue. It was caused by an autorun script for cmd (clink). Using regedit, go to Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Command Processor and change the Autorun key to blank.