nodejs / node-gyp

Node.js native addon build tool
MIT License
9.92k stars 1.79k forks source link

Call to 'node -e "require('nan')"' returned exit status 0 while in binding.gyp #2337

Closed amunim closed 3 years ago

amunim commented 3 years ago
I'm trying to install robotjs and its been 2 days without any luck, constantly getting this error. I have even copy pasted nan module in node-gyp node_modules and robotjs node_modules and it is still not installing nor rebuilding ``` gyp: Call to 'node -e "require('nan')"' returned exit status 0 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:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:351:16) gyp ERR! stack at emitTwo (events.js:126:13) gyp ERR! stack at ChildProcess.emit (events.js:214:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12) gyp ERR! System Windows_NT 10.0.18363 ```
my package.json ``` { "name": "MY SECRET PROJECT NAME", "version": "1.0.0", "description": "", "main": "main.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "electron ." }, "author": "", "license": "ISC", "dependencies": { "electron-prompt": "^1.6.1", "electron-store": "^7.0.2", "iohook": "^0.7.2", "puppeteer": "^7.1.0", "robotjs": "^0.6.0" }, "devDependencies": { "electron": "^11.3.0" }, "iohook": { "targets": [ "node-88", "electron-85" ], "platforms": [ "win32" ], "arches": [ "x64", "ia32" ] } } ```

Current Workaround:

Make a new project with npm init then run npm i robotjs, you can also use .npmrc to download directly for electron like this:

``` runtime = electron target = 11.3.0 target_arch = ia32 disturl = https://atom.io/download/atom-shell ```

after downloading and on a new project robotjs will install successfully now copy everything inside your new project's node_modules folder and paste it in the project's node_modules in which it is not working. Lastly add robotjs: 0.6.0 or the version you downloaded to the project's package.json

Culprit: npm

Reasoning:

npm was removing packages when running npm install command so I think removed modules were required by robotjs, now I had to manually add them in node_modules folder.

NOTE: You have to do this every time if you can't run npm i robotjs, npm rebuild.

cclauss commented 3 years ago

Please provide

  1. the command that you typed
  2. the full error log.
amunim commented 3 years ago

The command I typed was npm i robotjs

and here is the full error log by npm ``` 0 verbose cli [ 0 verbose cli 'C:\\Program Files (x86)\\nodejs\\node.exe', 0 verbose cli 'C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js', 0 verbose cli 'i', 0 verbose cli 'robotjs' 0 verbose cli ] 1 info using npm@7.5.3 2 info using node@v15.10.0 3 timing config:load:defaults Completed in 1ms 4 timing config:load:file:C:\Program Files (x86)\nodejs\node_modules\npm\npmrc Completed in 1ms 5 timing config:load:builtin Completed in 1ms 6 timing config:load:cli Completed in 1ms 7 timing config:load:env Completed in 0ms 8 timing config:load:file:D:\projects\Upwork\some\.npmrc Completed in 1ms 9 timing config:load:project Completed in 2ms 10 timing config:load:file:C:\Users\Khizer\.npmrc Completed in 0ms 11 timing config:load:user Completed in 0ms 12 timing config:load:file:C:\Users\Khizer\AppData\Roaming\npm\etc\npmrc Completed in 0ms 13 timing config:load:global Completed in 1ms 14 timing config:load:cafile Completed in 0ms 15 timing config:load:validate Completed in 0ms 16 timing config:load:setUserAgent Completed in 1ms 17 timing config:load:setEnvs Completed in 1ms 18 timing config:load Completed in 9ms 19 verbose npm-session 8858c340fbcbaa36 20 timing npm:load Completed in 19ms 21 timing arborist:ctor Completed in 0ms 22 timing idealTree:init Completed in 140ms 23 timing idealTree:userRequests Completed in 2ms 24 silly idealTree buildDeps 25 silly fetch manifest robotjs@* 26 http fetch GET 304 https://registry.npmjs.org/robotjs 295ms (from cache) 27 silly placeDep ROOT robotjs@0.6.0 OK for: stocks-copy@1.0.0 want: * 28 silly fetch manifest nan@^2.14.0 29 silly fetch manifest prebuild-install@^5.3.3 30 http fetch GET 304 https://registry.npmjs.org/nan 79ms (from cache) 31 http fetch GET 304 https://registry.npmjs.org/prebuild-install 1106ms (from cache) 32 timing idealTree:#root Completed in 1412ms 33 silly placeDep ROOT nan@2.14.2 OK for: robotjs@0.6.0 want: ^2.14.0 34 silly placeDep ROOT prebuild-install@5.3.6 OK for: robotjs@0.6.0 want: ^5.3.3 35 silly fetch manifest detect-libc@^1.0.3 36 silly fetch manifest expand-template@^2.0.3 37 silly fetch manifest github-from-package@0.0.0 38 silly fetch manifest napi-build-utils@^1.0.1 39 silly fetch manifest noop-logger@^0.1.1 40 silly fetch manifest npmlog@^4.0.1 41 silly fetch manifest simple-get@^3.0.3 42 silly fetch manifest which-pm-runs@^1.0.0 43 http fetch GET 304 https://registry.npmjs.org/detect-libc 76ms (from cache) 44 http fetch GET 304 https://registry.npmjs.org/napi-build-utils 81ms (from cache) 45 http fetch GET 304 https://registry.npmjs.org/expand-template 143ms (from cache) 46 http fetch GET 304 https://registry.npmjs.org/npmlog 141ms (from cache) 47 http fetch GET 304 https://registry.npmjs.org/which-pm-runs 145ms (from cache) 48 http fetch GET 304 https://registry.npmjs.org/simple-get 155ms (from cache) 49 http fetch GET 304 https://registry.npmjs.org/noop-logger 160ms (from cache) 50 http fetch GET 304 https://registry.npmjs.org/github-from-package 1117ms (from cache) 51 timing idealTree:node_modules/robotjs Completed in 1125ms 52 timing idealTree:node_modules/nan Completed in 0ms 53 silly placeDep ROOT detect-libc@1.0.3 OK for: prebuild-install@5.3.6 want: ^1.0.3 54 silly placeDep ROOT expand-template@2.0.3 OK for: prebuild-install@5.3.6 want: ^2.0.3 55 silly placeDep ROOT github-from-package@0.0.0 OK for: prebuild-install@5.3.6 want: 0.0.0 56 silly placeDep ROOT napi-build-utils@1.0.2 OK for: prebuild-install@5.3.6 want: ^1.0.1 57 silly placeDep ROOT noop-logger@0.1.1 OK for: prebuild-install@5.3.6 want: ^0.1.1 58 silly placeDep ROOT npmlog@4.1.2 OK for: prebuild-install@5.3.6 want: ^4.0.1 59 silly placeDep ROOT simple-get@3.1.0 OK for: prebuild-install@5.3.6 want: ^3.0.3 60 silly placeDep ROOT which-pm-runs@1.0.0 OK for: prebuild-install@5.3.6 want: ^1.0.0 61 silly fetch manifest are-we-there-yet@~1.1.2 62 silly fetch manifest console-control-strings@~1.1.0 63 silly fetch manifest gauge@~2.7.3 64 silly fetch manifest set-blocking@~2.0.0 65 silly fetch manifest decompress-response@^4.2.0 66 silly fetch manifest simple-concat@^1.0.0 67 http fetch GET 304 https://registry.npmjs.org/decompress-response 81ms (from cache) 68 http fetch GET 304 https://registry.npmjs.org/console-control-strings 102ms (from cache) 69 http fetch GET 304 https://registry.npmjs.org/are-we-there-yet 109ms (from cache) 70 http fetch GET 304 https://registry.npmjs.org/simple-concat 106ms (from cache) 71 http fetch GET 304 https://registry.npmjs.org/gauge 112ms (from cache) 72 http fetch GET 304 https://registry.npmjs.org/set-blocking 113ms (from cache) 73 timing idealTree:node_modules/prebuild-install Completed in 129ms 74 timing idealTree:node_modules/detect-libc Completed in 0ms 75 timing idealTree:node_modules/expand-template Completed in 0ms 76 timing idealTree:node_modules/github-from-package Completed in 0ms 77 timing idealTree:node_modules/napi-build-utils Completed in 0ms 78 timing idealTree:node_modules/noop-logger Completed in 0ms 79 silly placeDep ROOT are-we-there-yet@1.1.5 OK for: npmlog@4.1.2 want: ~1.1.2 80 silly placeDep ROOT console-control-strings@1.1.0 OK for: npmlog@4.1.2 want: ~1.1.0 81 silly placeDep ROOT gauge@2.7.4 OK for: npmlog@4.1.2 want: ~2.7.3 82 silly placeDep ROOT set-blocking@2.0.0 OK for: npmlog@4.1.2 want: ~2.0.0 83 silly fetch manifest delegates@^1.0.0 84 silly fetch manifest readable-stream@^2.0.6 85 silly fetch manifest aproba@^1.0.3 86 silly fetch manifest has-unicode@^2.0.0 87 silly fetch manifest wide-align@^1.1.0 88 http fetch GET 304 https://registry.npmjs.org/aproba 73ms (from cache) 89 http fetch GET 304 https://registry.npmjs.org/wide-align 82ms (from cache) 90 http fetch GET 304 https://registry.npmjs.org/has-unicode 86ms (from cache) 91 http fetch GET 304 https://registry.npmjs.org/delegates 90ms (from cache) 92 http fetch GET 304 https://registry.npmjs.org/readable-stream 96ms (from cache) 93 timing idealTree:node_modules/npmlog Completed in 102ms 94 silly placeDep ROOT delegates@1.0.0 OK for: are-we-there-yet@1.1.5 want: ^1.0.0 95 silly placeDep node_modules/are-we-there-yet readable-stream@2.3.7 OK for: are-we-there-yet@1.1.5 want: ^2.0.6 96 silly fetch manifest safe-buffer@~5.1.1 97 silly fetch manifest string_decoder@~1.1.1 98 http fetch GET 304 https://registry.npmjs.org/string_decoder 48ms (from cache) 99 http fetch GET 304 https://registry.npmjs.org/safe-buffer 61ms (from cache) 100 timing idealTree:node_modules/are-we-there-yet Completed in 63ms 101 timing idealTree:node_modules/console-control-strings Completed in 0ms 102 timing idealTree:node_modules/delegates Completed in 0ms 103 silly placeDep ROOT aproba@1.2.0 OK for: gauge@2.7.4 want: ^1.0.3 104 silly placeDep ROOT has-unicode@2.0.1 OK for: gauge@2.7.4 want: ^2.0.0 105 silly placeDep ROOT wide-align@1.1.3 OK for: gauge@2.7.4 want: ^1.1.0 106 timing idealTree:node_modules/gauge Completed in 2ms 107 timing idealTree:node_modules/aproba Completed in 0ms 108 timing idealTree:node_modules/has-unicode Completed in 0ms 109 timing idealTree:node_modules/set-blocking Completed in 0ms 110 silly placeDep ROOT decompress-response@4.2.1 OK for: simple-get@3.1.0 want: ^4.2.0 111 silly placeDep ROOT simple-concat@1.0.1 OK for: simple-get@3.1.0 want: ^1.0.0 112 silly fetch manifest mimic-response@^2.0.0 113 http fetch GET 304 https://registry.npmjs.org/mimic-response 52ms (from cache) 114 timing idealTree:node_modules/simple-get Completed in 55ms 115 silly placeDep ROOT mimic-response@2.1.0 OK for: decompress-response@4.2.1 want: ^2.0.0 116 timing idealTree:node_modules/decompress-response Completed in 1ms 117 timing idealTree:node_modules/mimic-response Completed in 0ms 118 timing idealTree:node_modules/simple-concat Completed in 0ms 119 timing idealTree:node_modules/which-pm-runs Completed in 0ms 120 timing idealTree:node_modules/wide-align Completed in 0ms 121 silly placeDep node_modules/are-we-there-yet safe-buffer@5.1.2 OK for: readable-stream@2.3.7 want: ~5.1.1 122 silly placeDep node_modules/are-we-there-yet string_decoder@1.1.1 OK for: readable-stream@2.3.7 want: ~1.1.1 123 timing idealTree:node_modules/are-we-there-yet/node_modules/readable-stream Completed in 3ms 124 timing idealTree:node_modules/are-we-there-yet/node_modules/safe-buffer Completed in 0ms 125 timing idealTree:node_modules/are-we-there-yet/node_modules/string_decoder Completed in 0ms 126 timing idealTree:buildDeps Completed in 2893ms 127 timing idealTree:fixDepFlags Completed in 5ms 128 timing idealTree Completed in 3045ms 129 timing reify:loadTrees Completed in 3046ms 130 timing reify:diffTrees Completed in 15ms 131 silly reify moves {} 132 timing reify:retireShallow Completed in 0ms 133 timing reify:createSparse Completed in 13ms 134 timing reify:loadBundles Completed in 0ms 135 timing reifyNode:node_modules/wide-align Completed in 304ms 136 timing reifyNode:node_modules/aproba Completed in 304ms 137 timing reifyNode:node_modules/which-pm-runs Completed in 309ms 138 timing reifyNode:node_modules/simple-get Completed in 311ms 139 timing reifyNode:node_modules/mimic-response Completed in 320ms 140 timing reifyNode:node_modules/decompress-response Completed in 322ms 141 timing reifyNode:node_modules/has-unicode Completed in 321ms 142 timing reifyNode:node_modules/set-blocking Completed in 322ms 143 timing reifyNode:node_modules/console-control-strings Completed in 322ms 144 timing reifyNode:node_modules/expand-template Completed in 327ms 145 timing reifyNode:node_modules/simple-concat Completed in 331ms 146 timing reifyNode:node_modules/are-we-there-yet/node_modules/string_decoder Completed in 330ms 147 timing reifyNode:node_modules/are-we-there-yet/node_modules/safe-buffer Completed in 331ms 148 timing reifyNode:node_modules/npmlog Completed in 333ms 149 timing reifyNode:node_modules/napi-build-utils Completed in 333ms 150 timing reifyNode:node_modules/delegates Completed in 342ms 151 timing reifyNode:node_modules/noop-logger Completed in 346ms 152 timing reifyNode:node_modules/detect-libc Completed in 346ms 153 timing reifyNode:node_modules/are-we-there-yet Completed in 349ms 154 timing reifyNode:node_modules/github-from-package Completed in 356ms 155 timing reifyNode:node_modules/prebuild-install Completed in 376ms 156 timing reifyNode:node_modules/gauge Completed in 388ms 157 timing reifyNode:node_modules/are-we-there-yet/node_modules/readable-stream Completed in 435ms 158 timing reifyNode:node_modules/nan Completed in 567ms 159 timing reifyNode:node_modules/robotjs Completed in 584ms 160 timing reify:unpack Completed in 587ms 161 timing reify:unretire Completed in 1ms 162 timing build:queue Completed in 3ms 163 timing build:link:node_modules/detect-libc Completed in 22ms 164 timing build:link:node_modules/prebuild-install Completed in 26ms 165 timing build:link Completed in 27ms 166 info run robotjs@0.6.0 install node_modules/robotjs prebuild-install || node-gyp rebuild 167 http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 1275ms 168 timing auditReport:getReport Completed in 1278ms 169 timing auditReport:init Completed in 0ms 170 timing reify:audit Completed in 1279ms 171 info run robotjs@0.6.0 install { code: 1, signal: null } 172 timing reify:rollback:createSparse Completed in 120ms 173 timing reify:rollback:retireShallow Completed in 0ms 174 timing command:install Completed in 5985ms 175 verbose stack Error: command failed 175 verbose stack at ChildProcess. (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\@npmcli\promise-spawn\index.js:64:27) 175 verbose stack at ChildProcess.emit (node:events:378:20) 175 verbose stack at maybeClose (node:internal/child_process:1067:16) 175 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5) 176 verbose pkgid robotjs@0.6.0 177 verbose cwd D:\projects\Upwork\some 178 verbose Windows_NT 10.0.18363 179 verbose argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i" "robotjs" 180 verbose node v15.10.0 181 verbose npm v7.5.3 182 error code 1 183 error path D:\projects\Upwork\some\node_modules\robotjs 184 error command failed 185 error command C:\WINDOWS\system32\cmd.exe /d /s /c prebuild-install || node-gyp rebuild 186 error gyp info it worked if it ends with ok 186 error gyp info using node-gyp@7.1.2 186 error gyp info using node@15.10.0 | win32 | ia32 186 error gyp info find Python using Python version 2.7.17 found at "C:\Users\Khizer\.windows-build-tools\python27\python.exe" 186 error gyp info find VS using VS2019 (16.6.30225.117) found at: 186 error gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community" 186 error gyp info find VS run with --verbose for detailed information 186 error gyp info spawn C:\Users\Khizer\.windows-build-tools\python27\python.exe 186 error gyp info spawn args [ 186 error gyp info spawn args 'C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py', 186 error gyp info spawn args 'binding.gyp', 186 error gyp info spawn args '-f', 186 error gyp info spawn args 'msvs', 186 error gyp info spawn args '-I', 186 error gyp info spawn args 'D:\\projects\\Upwork\\some\\node_modules\\robotjs\\build\\config.gypi', 186 error gyp info spawn args '-I', 186 error gyp info spawn args 'C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi', 186 error gyp info spawn args '-I', 186 error gyp info spawn args 'C:\\Users\\Khizer\\AppData\\Local\\node-gyp\\Cache\\11.3.0\\include\\node\\common.gypi', 186 error gyp info spawn args '-Dlibrary=shared_library', 186 error gyp info spawn args '-Dvisibility=default', 186 error gyp info spawn args '-Dnode_root_dir=C:\\Users\\Khizer\\AppData\\Local\\node-gyp\\Cache\\11.3.0', 186 error gyp info spawn args '-Dnode_gyp_dir=C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\node-gyp', 186 error gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\Khizer\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\11.3.0\\\\<(target_arch)\\\\node.lib', 186 error gyp info spawn args '-Dmodule_root_dir=D:\\projects\\Upwork\\some\\node_modules\\robotjs', 186 error gyp info spawn args '-Dnode_engine=v8', 186 error gyp info spawn args '--depth=.', 186 error gyp info spawn args '--no-parallel', 186 error gyp info spawn args '--generator-output', 186 error gyp info spawn args 'D:\\projects\\Upwork\\some\\node_modules\\robotjs\\build', 186 error gyp info spawn args '-Goutput_dir=.' 186 error gyp info spawn args ] 186 error Debugger listening on ws://127.0.0.1:50245/ec1c38d2-ca2a-4e1f-92cc-b04055f068de 186 error For help, see: https://nodejs.org/en/docs/inspector 186 error Debugger attached. 186 error Waiting for the debugger to disconnect... 186 error gyp: Call to 'node -e "require('nan')"' returned exit status 0 while in binding.gyp. while trying to load binding.gyp 186 error gyp ERR! configure error 186 error gyp ERR! stack Error: `gyp` failed with exit code: 1 186 error gyp ERR! stack at ChildProcess.onCpExit (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:351:16) 186 error gyp ERR! stack at ChildProcess.emit (node:events:378:20) 186 error gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12) 186 error gyp ERR! System Windows_NT 10.0.18363 186 error gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" 186 error gyp ERR! cwd D:\projects\Upwork\some\node_modules\robotjs 186 error gyp ERR! node -v v15.10.0 186 error gyp ERR! node-gyp -v v7.1.2 186 error gyp ERR! not ok 187 verbose exit 1 ```
amunim commented 3 years ago
and here is the full error log with python 3.8.7 ``` 0 verbose cli [ 0 verbose cli 'C:\\Program Files (x86)\\nodejs\\node.exe', 0 verbose cli 'C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js', 0 verbose cli 'i', 0 verbose cli 'robotjs' 0 verbose cli ] 1 info using npm@7.5.3 2 info using node@v15.10.0 3 timing config:load:defaults Completed in 2ms 4 timing config:load:file:C:\Program Files (x86)\nodejs\node_modules\npm\npmrc Completed in 2ms 5 timing config:load:builtin Completed in 2ms 6 timing config:load:cli Completed in 1ms 7 timing config:load:env Completed in 0ms 8 timing config:load:file:D:\projects\Upwork\some\.npmrc Completed in 1ms 9 timing config:load:project Completed in 2ms 10 timing config:load:file:C:\Users\Khizer\.npmrc Completed in 0ms 11 timing config:load:user Completed in 0ms 12 timing config:load:file:C:\Users\Khizer\AppData\Roaming\npm\etc\npmrc Completed in 0ms 13 timing config:load:global Completed in 0ms 14 timing config:load:cafile Completed in 1ms 15 timing config:load:validate Completed in 0ms 16 timing config:load:setUserAgent Completed in 1ms 17 timing config:load:setEnvs Completed in 1ms 18 timing config:load Completed in 11ms 19 verbose npm-session 9f3f592ecfacdd1a 20 timing npm:load Completed in 23ms 21 timing arborist:ctor Completed in 1ms 22 timing idealTree:init Completed in 184ms 23 timing idealTree:userRequests Completed in 3ms 24 silly idealTree buildDeps 25 silly fetch manifest robotjs@* 26 http fetch GET 304 https://registry.npmjs.org/robotjs 341ms (from cache) 27 silly placeDep ROOT robotjs@0.6.0 OK for: stocks-copy@1.0.0 want: * 28 silly fetch manifest nan@^2.14.0 29 silly fetch manifest prebuild-install@^5.3.3 30 http fetch GET 304 https://registry.npmjs.org/nan 69ms (from cache) 31 http fetch GET 304 https://registry.npmjs.org/prebuild-install 110ms (from cache) 32 timing idealTree:#root Completed in 464ms 33 silly placeDep ROOT nan@2.14.2 OK for: robotjs@0.6.0 want: ^2.14.0 34 silly placeDep ROOT prebuild-install@5.3.6 OK for: robotjs@0.6.0 want: ^5.3.3 35 silly fetch manifest detect-libc@^1.0.3 36 silly fetch manifest expand-template@^2.0.3 37 silly fetch manifest github-from-package@0.0.0 38 silly fetch manifest napi-build-utils@^1.0.1 39 silly fetch manifest noop-logger@^0.1.1 40 silly fetch manifest npmlog@^4.0.1 41 silly fetch manifest simple-get@^3.0.3 42 silly fetch manifest which-pm-runs@^1.0.0 43 http fetch GET 304 https://registry.npmjs.org/detect-libc 93ms (from cache) 44 http fetch GET 304 https://registry.npmjs.org/expand-template 105ms (from cache) 45 http fetch GET 304 https://registry.npmjs.org/noop-logger 135ms (from cache) 46 http fetch GET 304 https://registry.npmjs.org/simple-get 152ms (from cache) 47 http fetch GET 304 https://registry.npmjs.org/github-from-package 161ms (from cache) 48 http fetch GET 304 https://registry.npmjs.org/npmlog 237ms (from cache) 49 http fetch GET 304 https://registry.npmjs.org/napi-build-utils 1132ms (from cache) 50 http fetch GET 304 https://registry.npmjs.org/which-pm-runs 1126ms (from cache) 51 timing idealTree:node_modules/robotjs Completed in 1145ms 52 timing idealTree:node_modules/nan Completed in 0ms 53 silly placeDep ROOT detect-libc@1.0.3 OK for: prebuild-install@5.3.6 want: ^1.0.3 54 silly placeDep ROOT expand-template@2.0.3 OK for: prebuild-install@5.3.6 want: ^2.0.3 55 silly placeDep ROOT github-from-package@0.0.0 OK for: prebuild-install@5.3.6 want: 0.0.0 56 silly placeDep ROOT napi-build-utils@1.0.2 OK for: prebuild-install@5.3.6 want: ^1.0.1 57 silly placeDep ROOT noop-logger@0.1.1 OK for: prebuild-install@5.3.6 want: ^0.1.1 58 silly placeDep ROOT npmlog@4.1.2 OK for: prebuild-install@5.3.6 want: ^4.0.1 59 silly placeDep ROOT simple-get@3.1.0 OK for: prebuild-install@5.3.6 want: ^3.0.3 60 silly placeDep ROOT which-pm-runs@1.0.0 OK for: prebuild-install@5.3.6 want: ^1.0.0 61 silly fetch manifest are-we-there-yet@~1.1.2 62 silly fetch manifest console-control-strings@~1.1.0 63 silly fetch manifest gauge@~2.7.3 64 silly fetch manifest set-blocking@~2.0.0 65 silly fetch manifest decompress-response@^4.2.0 66 silly fetch manifest simple-concat@^1.0.0 67 http fetch GET 304 https://registry.npmjs.org/simple-concat 104ms (from cache) 68 http fetch GET 304 https://registry.npmjs.org/decompress-response 106ms (from cache) 69 http fetch GET 304 https://registry.npmjs.org/console-control-strings 113ms (from cache) 70 http fetch GET 304 https://registry.npmjs.org/are-we-there-yet 116ms (from cache) 71 http fetch GET 304 https://registry.npmjs.org/set-blocking 289ms (from cache) 72 http fetch GET 304 https://registry.npmjs.org/gauge 303ms (from cache) 73 timing idealTree:node_modules/prebuild-install Completed in 325ms 74 timing idealTree:node_modules/detect-libc Completed in 0ms 75 timing idealTree:node_modules/expand-template Completed in 0ms 76 timing idealTree:node_modules/github-from-package Completed in 0ms 77 timing idealTree:node_modules/napi-build-utils Completed in 0ms 78 timing idealTree:node_modules/noop-logger Completed in 0ms 79 silly placeDep ROOT are-we-there-yet@1.1.5 OK for: npmlog@4.1.2 want: ~1.1.2 80 silly placeDep ROOT console-control-strings@1.1.0 OK for: npmlog@4.1.2 want: ~1.1.0 81 silly placeDep ROOT gauge@2.7.4 OK for: npmlog@4.1.2 want: ~2.7.3 82 silly placeDep ROOT set-blocking@2.0.0 OK for: npmlog@4.1.2 want: ~2.0.0 83 silly fetch manifest delegates@^1.0.0 84 silly fetch manifest readable-stream@^2.0.6 85 silly fetch manifest aproba@^1.0.3 86 silly fetch manifest has-unicode@^2.0.0 87 silly fetch manifest wide-align@^1.1.0 88 http fetch GET 304 https://registry.npmjs.org/delegates 93ms (from cache) 89 http fetch GET 304 https://registry.npmjs.org/aproba 90ms (from cache) 90 http fetch GET 304 https://registry.npmjs.org/wide-align 86ms (from cache) 91 http fetch GET 304 https://registry.npmjs.org/has-unicode 102ms (from cache) 92 http fetch GET 304 https://registry.npmjs.org/readable-stream 107ms (from cache) 93 timing idealTree:node_modules/npmlog Completed in 117ms 94 silly placeDep ROOT delegates@1.0.0 OK for: are-we-there-yet@1.1.5 want: ^1.0.0 95 silly placeDep node_modules/are-we-there-yet readable-stream@2.3.7 OK for: are-we-there-yet@1.1.5 want: ^2.0.6 96 silly fetch manifest safe-buffer@~5.1.1 97 silly fetch manifest string_decoder@~1.1.1 98 http fetch GET 304 https://registry.npmjs.org/string_decoder 50ms (from cache) 99 http fetch GET 304 https://registry.npmjs.org/safe-buffer 61ms (from cache) 100 timing idealTree:node_modules/are-we-there-yet Completed in 65ms 101 timing idealTree:node_modules/console-control-strings Completed in 0ms 102 timing idealTree:node_modules/delegates Completed in 0ms 103 silly placeDep ROOT aproba@1.2.0 OK for: gauge@2.7.4 want: ^1.0.3 104 silly placeDep ROOT has-unicode@2.0.1 OK for: gauge@2.7.4 want: ^2.0.0 105 silly placeDep ROOT wide-align@1.1.3 OK for: gauge@2.7.4 want: ^1.1.0 106 timing idealTree:node_modules/gauge Completed in 4ms 107 timing idealTree:node_modules/aproba Completed in 0ms 108 timing idealTree:node_modules/has-unicode Completed in 0ms 109 timing idealTree:node_modules/set-blocking Completed in 0ms 110 silly placeDep ROOT decompress-response@4.2.1 OK for: simple-get@3.1.0 want: ^4.2.0 111 silly placeDep ROOT simple-concat@1.0.1 OK for: simple-get@3.1.0 want: ^1.0.0 112 silly fetch manifest mimic-response@^2.0.0 113 http fetch GET 304 https://registry.npmjs.org/mimic-response 51ms (from cache) 114 timing idealTree:node_modules/simple-get Completed in 54ms 115 silly placeDep ROOT mimic-response@2.1.0 OK for: decompress-response@4.2.1 want: ^2.0.0 116 timing idealTree:node_modules/decompress-response Completed in 2ms 117 timing idealTree:node_modules/mimic-response Completed in 0ms 118 timing idealTree:node_modules/simple-concat Completed in 0ms 119 timing idealTree:node_modules/which-pm-runs Completed in 0ms 120 timing idealTree:node_modules/wide-align Completed in 0ms 121 silly placeDep node_modules/are-we-there-yet safe-buffer@5.1.2 OK for: readable-stream@2.3.7 want: ~5.1.1 122 silly placeDep node_modules/are-we-there-yet string_decoder@1.1.1 OK for: readable-stream@2.3.7 want: ~1.1.1 123 timing idealTree:node_modules/are-we-there-yet/node_modules/readable-stream Completed in 3ms 124 timing idealTree:node_modules/are-we-there-yet/node_modules/safe-buffer Completed in 0ms 125 timing idealTree:node_modules/are-we-there-yet/node_modules/string_decoder Completed in 0ms 126 timing idealTree:buildDeps Completed in 2182ms 127 timing idealTree:fixDepFlags Completed in 8ms 128 timing idealTree Completed in 2386ms 129 timing reify:loadTrees Completed in 2388ms 130 timing reify:diffTrees Completed in 18ms 131 silly reify moves {} 132 timing reify:retireShallow Completed in 0ms 133 timing reify:createSparse Completed in 13ms 134 timing reify:loadBundles Completed in 0ms 135 timing reifyNode:node_modules/wide-align Completed in 328ms 136 timing reifyNode:node_modules/has-unicode Completed in 329ms 137 timing reifyNode:node_modules/aproba Completed in 329ms 138 timing reifyNode:node_modules/which-pm-runs Completed in 329ms 139 timing reifyNode:node_modules/simple-get Completed in 328ms 140 timing reifyNode:node_modules/mimic-response Completed in 335ms 141 timing reifyNode:node_modules/decompress-response Completed in 336ms 142 timing reifyNode:node_modules/set-blocking Completed in 336ms 143 timing reifyNode:node_modules/console-control-strings Completed in 343ms 144 timing reifyNode:node_modules/expand-template Completed in 347ms 145 timing reifyNode:node_modules/simple-concat Completed in 354ms 146 timing reifyNode:node_modules/napi-build-utils Completed in 360ms 147 timing reifyNode:node_modules/are-we-there-yet/node_modules/string_decoder Completed in 361ms 148 timing reifyNode:node_modules/are-we-there-yet/node_modules/safe-buffer Completed in 362ms 149 timing reifyNode:node_modules/npmlog Completed in 361ms 150 timing reifyNode:node_modules/delegates Completed in 373ms 151 timing reifyNode:node_modules/noop-logger Completed in 378ms 152 timing reifyNode:node_modules/detect-libc Completed in 377ms 153 timing reifyNode:node_modules/are-we-there-yet Completed in 391ms 154 timing reifyNode:node_modules/github-from-package Completed in 403ms 155 timing reifyNode:node_modules/prebuild-install Completed in 432ms 156 timing reifyNode:node_modules/gauge Completed in 443ms 157 timing reifyNode:node_modules/are-we-there-yet/node_modules/readable-stream Completed in 546ms 158 timing reifyNode:node_modules/nan Completed in 657ms 159 timing reifyNode:node_modules/robotjs Completed in 686ms 160 timing reify:unpack Completed in 690ms 161 timing reify:unretire Completed in 0ms 162 timing build:queue Completed in 5ms 163 timing build:link:node_modules/detect-libc Completed in 23ms 164 timing build:link:node_modules/prebuild-install Completed in 22ms 165 timing build:link Completed in 24ms 166 info run robotjs@0.6.0 install node_modules/robotjs prebuild-install || node-gyp rebuild 167 http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 1135ms 168 timing auditReport:getReport Completed in 1138ms 169 timing auditReport:init Completed in 0ms 170 timing reify:audit Completed in 1140ms 171 info run robotjs@0.6.0 install { code: 1, signal: null } 172 timing reify:rollback:createSparse Completed in 155ms 173 timing reify:rollback:retireShallow Completed in 0ms 174 timing command:install Completed in 6845ms 175 verbose stack Error: command failed 175 verbose stack at ChildProcess. (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\@npmcli\promise-spawn\index.js:64:27) 175 verbose stack at ChildProcess.emit (node:events:378:20) 175 verbose stack at maybeClose (node:internal/child_process:1067:16) 175 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5) 176 verbose pkgid robotjs@0.6.0 177 verbose cwd D:\projects\Upwork\some 178 verbose Windows_NT 10.0.18363 179 verbose argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i" "robotjs" 180 verbose node v15.10.0 181 verbose npm v7.5.3 182 error code 1 183 error path D:\projects\Upwork\some\node_modules\robotjs 184 error command failed 185 error command C:\WINDOWS\system32\cmd.exe /d /s /c prebuild-install || node-gyp rebuild 186 error gyp info it worked if it ends with ok 186 error gyp info using node-gyp@7.1.2 186 error gyp info using node@15.10.0 | win32 | ia32 186 error gyp info find Python using Python version 3.8.7 found at "C:\Users\Khizer\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe" 186 error gyp info find VS using VS2017 (15.9.28307.1401) found at: 186 error gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools" 186 error gyp info find VS run with --verbose for detailed information 186 error gyp info spawn C:\Users\Khizer\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe 186 error gyp info spawn args [ 186 error gyp info spawn args 'C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py', 186 error gyp info spawn args 'binding.gyp', 186 error gyp info spawn args '-f', 186 error gyp info spawn args 'msvs', 186 error gyp info spawn args '-I', 186 error gyp info spawn args 'D:\\projects\\Upwork\\some\\node_modules\\robotjs\\build\\config.gypi', 186 error gyp info spawn args '-I', 186 error gyp info spawn args 'C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi', 186 error gyp info spawn args '-I', 186 error gyp info spawn args 'C:\\Users\\Khizer\\AppData\\Local\\node-gyp\\Cache\\11.3.0\\include\\node\\common.gypi', 186 error gyp info spawn args '-Dlibrary=shared_library', 186 error gyp info spawn args '-Dvisibility=default', 186 error gyp info spawn args '-Dnode_root_dir=C:\\Users\\Khizer\\AppData\\Local\\node-gyp\\Cache\\11.3.0', 186 error gyp info spawn args '-Dnode_gyp_dir=C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\node-gyp', 186 error gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\Khizer\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\11.3.0\\\\<(target_arch)\\\\node.lib', 186 error gyp info spawn args '-Dmodule_root_dir=D:\\projects\\Upwork\\some\\node_modules\\robotjs', 186 error gyp info spawn args '-Dnode_engine=v8', 186 error gyp info spawn args '--depth=.', 186 error gyp info spawn args '--no-parallel', 186 error gyp info spawn args '--generator-output', 186 error gyp info spawn args 'D:\\projects\\Upwork\\some\\node_modules\\robotjs\\build', 186 error gyp info spawn args '-Goutput_dir=.' 186 error gyp info spawn args ] 186 error Debugger listening on ws://127.0.0.1:50446/d8ca500e-aa87-4ed0-b670-1b0dcc55cf29 186 error For help, see: https://nodejs.org/en/docs/inspector 186 error Debugger attached. 186 error Waiting for the debugger to disconnect... 186 error gyp: Call to 'node -e "require('nan')"' returned exit status 0 while in binding.gyp. while trying to load binding.gyp 186 error gyp ERR! configure error 186 error gyp ERR! stack Error: `gyp` failed with exit code: 1 186 error gyp ERR! stack at ChildProcess.onCpExit (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:351:16) 186 error gyp ERR! stack at ChildProcess.emit (node:events:378:20) 186 error gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12) 186 error gyp ERR! System Windows_NT 10.0.18363 186 error gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" 186 error gyp ERR! cwd D:\projects\Upwork\some\node_modules\robotjs 186 error gyp ERR! node -v v15.10.0 186 error gyp ERR! node-gyp -v v7.1.2 186 error gyp ERR! not ok 187 verbose exit 1 ```
deepinsea commented 3 years ago

I also met the same problem. How did I solve it?

amunim commented 3 years ago

@deepinsea I don't know how you solved it but I have updated the issue description. It has 'current workaround' which you can follow.

deepinsea commented 3 years ago

Python 2.7 and virtual studio 2017 are configured,

The "node gyp configure" and "node gyp builld" commands still fail,

For this reason, I reduce the version node@14.15.2 , python 3.7 to 8.9.4 and python 2.7, Recently It seems that python2.7 support has been removed, but "NPM install -- global -- production windows build tools" still indicates that python3.7 is not available,

for this,It's very frustrating

I may need to spend a lot of time to solve this bug, rather than simply use it immediately

deepinsea commented 3 years ago

@amunim Does the latest version support python3.7 instead of python2.7? Can you give me a list of configurations that work well? For example: node: 14.15.2 python: 3.7 virtual studio: 2017 ......

cclauss commented 3 years ago

See octalmage/robotjs#651

amunim commented 3 years ago

@amunim Does the latest version support python3.7 instead of python2.7? Can you give me a list of configurations that work well? For example: node: 14.15.2 python: 3.7 virtual studio: 2017 ......

My current build in which the workaround worked is: node: v15 python: 3.8 vstools: 2017

gyp info find VS using VS2017 (15.9.28307.1401) found at: //location
gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools"
gyp info find Python using Python version 3.8.8 found at //location
gyp info using node-gyp@7.1.2
gyp info using node@15.10.0 | win32 | ia32

it doesn't work if I try to install it directly to my project. It would be helpful, if you could actually read and try the way which worked for me and then post a reply :)

cclauss commented 3 years ago

It would be helpful if you could make robotjs automated tests on AppVeyor fail so that we can all see the problem. This would be especially helpful for folks like me who do not have a Windows box.

MondoGao commented 3 years ago

also meet the same problem on MacOS 15, Node 12, Python 3.8

MondoGao commented 3 years ago

image

cclauss commented 3 years ago

Then why is it so difficult to create the requested failing test?

MondoGao commented 3 years ago

Then why is it so difficult to create the requested failing test?

after removing .node-gyp cache, this issue magically disappear, I think it may be difficult to reproduce this issue in a clean environment.

alectrocute commented 3 years ago

This should be closed.

mattdoranfs commented 6 months ago

how can i remove .node-gyp cache?