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 :
VS 2017 build tools installed
Python 2.7 installed
npm install -g node-gyp
npm config set msvs_version 2017
npm config set python c:/python27 (also tried npm config set python 2.7 as per Microsoft)
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:
C:\Users\dling[eval]
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at [eval]:1:1
at Script.runInThisContext (vm.js:132:18)
at Object.runInThisContext (vm.js:309:38)
at internal/process/execution.js:77:19
at [eval]-wrapper:6:22
at evalScript (internal/process/execution.js:76:60) {
code: 'MODULE_NOT_FOUND',
requireStack: [ 'C:\Users\dling\[eval]' ]
}
gyp: Call to 'node -e "require('nan')"' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Users\dling\AppData\Roaming\nvm\v14.15.1\node_modules\node-gyp\lib\configure.js:353:16)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Windows_NT 10.0.19042
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\dling\Source\robotjs
gyp ERR! node -v v14.15.1
gyp ERR! node-gyp -v v8.2.0
gyp ERR! not ok
Possible Solution
Steps to Reproduce (for bugs)
npm init
npm install robotjs (nan error occurs)
node-gyp rebuild (same nan error occurs)
Your Environment
RobotJS version: 0.6.0
Node.js version: tried latest versions of 12, 14, and 16
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.
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
successfullyCurrent Behavior
Both commands
npm install robotjs node-gyp rebuild
result in the same error:
Error: Cannot find module 'nan' Require stack:
gyp
failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (C:\Users\dling\AppData\Roaming\nvm\v14.15.1\node_modules\node-gyp\lib\configure.js:353:16) gyp ERR! stack at ChildProcess.emit (events.js:315:20) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12) gyp ERR! System Windows_NT 10.0.19042 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd C:\Users\dling\Source\robotjs gyp ERR! node -v v14.15.1 gyp ERR! node-gyp -v v8.2.0 gyp ERR! not okPossible Solution
Steps to Reproduce (for bugs)
Your Environment