You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Short overview
Cannot use screen.find featrue because I cannot install dependency "@nut-tree/opencv-build".
Issue occurs on
local machine
Virtual machine
Docker container
Dev/Host system
Detailed error description
I was attempting to use the screen.find(imageResource())-feature, but it requires OpenCV. Every attempt to install it via npm or manually by copying files failed.
On the GitHub page of OpenCV, I found out, I need cmake. so I installed cmake and again attempted to install OpenCV but without success.
I also found on another page that i probably need the MS Media Feature Pack, so downloaded it, but installation failed.
So in summary ... mouse and keyboard control are quite nice, but the interesting things begin with screen finding. But it won't work, so at the moment, NutJS for me is just a small, not really usable toy.
Can you fix this issue or help me, what to do?
Steps to reproduce error
already installed nodejs and npm (latest version)
installed nutjs via npm and according to installation guide on nutjs website
using the folling code sniplets:
import * as NutJS from "@nut-tree/nut-js";
import "@nut-tree/template-matcher";
result = await NutJS.screen.find(NutJS.imageResource("../assets/images/async.png"));
then i get error message (siee additional content)
Additional content
C:\Users\RobertST\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:859
return new TSError(diagnosticText, diagnosticCodes, diagnostics);
^
TSError: ⨯ Unable to compile TypeScript:
src/tempCodeRunnerFile.ts(1,1): error TS2304: Cannot find name 'result'.
src/tempCodeRunnerFile.ts(1,10): error TS1375: 'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module.
src/tempCodeRunnerFile.ts(1,10): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher.
src/tempCodeRunnerFile.ts(1,16): error TS2304: Cannot find name 'NutJS'.
src/tempCodeRunnerFile.ts(1,34): error TS2304: Cannot find name 'NutJS'.
at createTSError (C:\Users\RobertST\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:859:12)
at reportTSError (C:\Users\RobertST\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:863:19)
at getOutput (C:\Users\RobertST\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:1077:36)
at Object.compile (C:\Users\RobertST\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:1433:41)
at Module.m._compile (C:\Users\RobertST\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:1617:30)
at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
at Object.require.extensions.<computed> [as .ts] (C:\Users\RobertST\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:1621:12)
at Module.load (node:internal/modules/cjs/loader:1091:32)
at Function.Module._load (node:internal/modules/cjs/loader:938:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12) {
Version
Short overview
Cannot use screen.find featrue because I cannot install dependency "@nut-tree/opencv-build".
Issue occurs on
local machine
Detailed error description
Steps to reproduce error
Additional content
C:\Users\RobertST\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:859
return new TSError(diagnosticText, diagnosticCodes, diagnostics);
^
TSError: ⨯ Unable to compile TypeScript:
src/tempCodeRunnerFile.ts(1,1): error TS2304: Cannot find name 'result'.
src/tempCodeRunnerFile.ts(1,10): error TS1375: 'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module.
src/tempCodeRunnerFile.ts(1,10): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher.
src/tempCodeRunnerFile.ts(1,16): error TS2304: Cannot find name 'NutJS'.
src/tempCodeRunnerFile.ts(1,34): error TS2304: Cannot find name 'NutJS'.
diagnosticCodes: [ 2304, 1375, 1378, 2304, 2304 ]
}
The text was updated successfully, but these errors were encountered: