Skip to content

Instantly share code, notes, and snippets.

View stoefln's full-sized avatar

Stephan Petzl stoefln

View GitHub Profile
@stoefln
stoefln / fix.js
Created May 27, 2019 09:59
Fix opencv4nodejs dependency issues with electron
/**
* This script takes care of resolving and packaging dependencies of opencv
* For some reason they are not found in the opencv-build folder, but in /usr/shared...
* MacOS provided ways to tell libraries where to find dependencies, so what we do here is to
* 1. iterate all opencv libraries
* 2. for each of them check for dependencies in /usr/...
* 3. copy each of those dependencies to our opencv-build/../dependencies dir
* 4. tell the opencv libraries to look in the opencv-build/../dependencies dir instead of in /usr/...
* 5. go through all the libraries in opencv-build/../dependencies and check for even more dependencies, take care of them the same way (see steps 1-4)
* 6. again: go through all the libraries in opencv-build/../dependencies and check for even more dependencies, take care of them the same way (see steps 1-4)
Uncaught Error: The specified module could not be found.
\\?\C:\Users\steph\AppData\Local\Temp\8b4c199c-3c7e-4ed5-a53e-a00355984acc.tmp.node
at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:166:20)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:740)
at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:180:18)
at Module.load (internal/modules/cjs/loader.js:620)
at tryModuleLoad (internal/modules/cjs/loader.js:559)
at Function.Module._load (internal/modules/cjs/loader.js:551)
at Module.require (internal/modules/cjs/loader.js:658)
at require (internal/modules/cjs/helpers.js:20)
yarn cross-env DEBUG_PROD=true yarn build build.log
yarn run v1.16.0
$ C:\Users\steph\electron-react-boilerplate-opencv4nodejs\node_modules\.bin\cross-env DEBUG_PROD=true yarn build build.log
$ concurrently "yarn build-main" "yarn build-renderer" build.log
$ cross-env NODE_ENV=production webpack --config ./configs/webpack.config.renderer.prod.babel.js --colors
$ cross-env NODE_ENV=production webpack --config ./configs/webpack.config.main.prod.babel.js --colors
[2] build.log exited with code 0
[1] Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade caniuse-lite browserslist`
[0] Hash: 8273de904a639b1c5176
[0] Version: webpack 4.26.0
• electron-builder version=20.38.5
• loaded configuration file=package.json ("build" field)
• installing production dependencies platform=win32 arch=x64 appDir=C:\Users\steph\MoviePrint_v004\app
Error: C:\Program Files\nodejs\node.exe exited with code 1
Output:
yarn install v1.16.0
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Error: C:\Program Files\nodejs\node.exe exited with code 1
Output:
yarn install v1.16.0
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Error output:
const notifier = require('node-notifier')
notifier.notify({
title: 'Repeato Build',
message: 'Your build finished!'
})
/**
* This script takes care of resolving and packaging dependencies of opencv
* For some reason they are not found in the opencv-build folder, but in /usr/shared...
* MacOS provides ways to tell libraries where to find dependencies, so what we do here is to
* 1. iterate all opencv libraries
* 2. for each of them check for dependencies in /usr/...
* 3. copy each of those dependencies to our opencv-build/../dependencies dir
* 4. tell the opencv libraries to look in the opencv-build/../dependencies dir instead of in /usr/...
* 5. go through all the libraries in opencv-build/../dependencies and check for even more dependencies, take care of them the same way (see steps 1-4)
* 6. again: go through all the libraries in opencv-build/../dependencies and check for even more dependencies, take care of them the same way (see steps 1-4)
@Test
fun logout() {
onView(withId(R.id.logoutButton))
.check(ViewAssertions.matches(
ViewMatchers.withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
onView(withId(R.id.logoutButton)).perform(click())
}
@Test
fun testFirstFeature() {
mainScreen {
logoutButton {
isVisible()
click()
}
}
}
fun shouldPassOnNoInternetScanTest() =
beforeTest {
activityTestRule.launchActivity(null)
}.afterTest {
// cleanup
}.run {
step("Open Next Screen") {
MainScreen {
nextButton {
isVisible()