Build iohook from source (with electron 4.0.0 and vue) - vue.js

I used vue-cli to create a vue app and then i added electron(4.0.0) via a plugin called vue-cli-plugin-electron-builder. Everything is ok and works properly.
The problem is with iohook which, as stated on their documentation, has prebuild versions for electron ABI <= 57 (in reality it's <= 64). It seems that on my project it automatically downloads and uses electron ABI(64) which is electron(3.0.0) (verified with node-abi).
electron(4.0.3/4) is ABI(69) (which is not supported). Judging by these circumstances i'm also considering that electron 4.0.0 has ABI(69) as well
iohook needs things specified in package.json [arch type, etc..] which i did specify.
iohook also wants me to npm run build but as of now it doesn't generate any build folder what so ever.
My solutions are:
Go back to electron 3.0.0
What are the differences between electron 3.0.0 and electron 4.0.x
Manually build iohook from source
Their documentation on manual building seems poor, at least for me. How do i actually do that? It's always throwing me errors / saying to cd in the lib's directory and npm run compile which doesn't work because arch type doesn't match.
As of now i want to manually build iohook.
UPDATE
I tried with electron 3.0.0 (barebones) and it's still throwing:
Error: Cannot find module 'F:\DOCS\OneDrive\Programming\NODE\type_analysis\dist_electron\builds\electron-v64-win32-x64\build\Release\iohook.node'
at webpackEmptyContext (webpack:///./node_modules/iohook_sync?:2:10)
at eval (webpack:///./node_modules/iohook/index.js?:10:80)
at Object../node_modules/iohook/index.js (F:\DOCS\OneDrive\Programming\NODE\type_analysis\dist_electron\index.js:252:1)
at __webpack_require__ (F:\DOCS\OneDrive\Programming\NODE\type_analysis\dist_electron\index.js:20:30)
at eval (webpack:///./src/background.js?:15:16)
at Module../src/background.js (F:\DOCS\OneDrive\Programming\NODE\type_analysis\dist_electron\index.js:1395:1)
at __webpack_require__ (F:\DOCS\OneDrive\Programming\NODE\type_analysis\dist_electron\index.js:20:30)
at eval (webpack:///multi_./src/background.js?:1:18)
at Object.0 (F:\DOCS\OneDrive\Programming\NODE\type_analysis\dist_electron\index.js:1406:1)
at __webpack_require__ (F:\DOCS\OneDrive\Programming\NODE\type_analysis\dist_electron\index.js:20:30)
UPDATE 2
Doesn't work with electron 2.0.0 either...
I also added the cmake-js thing in package.json
"cmake-js": {
"runtime": "electron",
"runtimeVersion": "2.0.0"
}
Tried electron-rebuild -f -w iohook as well, didn't solve the problem either

Support for Electron v2+ is here now (try iohook version 0.4+). We are currently working on the Win32/64 support for electron 4. All other platforms are fine. You can follow the debug here : https://github.com/wilix-team/iohook/pull/157

Related

Visual studio code error :-Failed to start flow Error: Wrong version of Flow. The config specifies version ^0.92.0 but this is version 0.95.1

Hello I am a beginner in React-native and below is my flowconfig file's version and I get an error with this version
[version]
^0.92.0
Is there a way to fix this error, I was trying to run debug mode in visual code for running react-native projects and to print console.log.
So far I am unsuccessful.
PS:- beginner in react-native
Change [version] in the .flowconfig to match the installed version, ^0.95.1
1. Check that the following tags match
package.json
"devDependencies": {
"flow-bin": "0.130.0"
}
.flowconfig
[version]
^0.130.0
2. Clean & Reinstall
If they match, this error can occur when your node_modules are out of sync with the version of flow-bin in your package.json. This can occur if you've changed branches recently or have have an older version in your node modules.
Try removing and reinstalling like this:
rm -rf node_modules/ && npm i
Instead of changing the flow version make it a ranged version. For example something like >=0.50.0 or simply remove the version altogether. You can read about that more in the flowconfig docs
I find that changing the flow version every time you face this problem to be a bad approach especially if you work with a team and each team member has a different version installed and they would commit their version into the .flowconfig file

Nuxt generate show error: Cannot read property 'normalModuleFactory' of undefined

Recently I upgrade Nuxt from 1.4.0 to 1.2.x and Vuetify from 1.0.9 to 1.2.x. After that npm run dev works fine. but when I run Nuxt generate I get below error. I am stuck on this error since last night and can't find any idea why it's occurring. Any guidance will be helpful. Thank in advance.
nuxt:build Generating files... +138ms
nuxt:build Generating routes... +13ms
nuxt:build Building files... +314ms
ERROR
TypeError: Cannot read property 'normalModuleFactory' of undefined
- IgnorePlugin.js:96 IgnorePlugin.apply
[vue]/[webpack]/lib/IgnorePlugin.js:96:18
- Tapable.js:375 Compiler.apply
[npm]/[nuxt]/[tapable]/lib/Tapable.js:375:16
- webpack.js:33 webpack
[npm]/[nuxt]/[webpack]/lib/webpack.js:33:19
- builder.js:524 compilers.compilersOptions.map.compilersOption
[npm]/[nuxt]/lib/builder/builder.js:524:24
- Array.map
- builder.js:523 Builder.webpackBuild
[npm]/[nuxt]/lib/builder/builder.js:523:39
- builder.js:168 Builder.build
[npm]/[nuxt]/lib/builder/builder.js:168:16
package.json can be find here.
nuxt.config.js can be found here.
I tried to dig about it, but it seems to be generated through webpack. So I updated to webpack 4 too. But still it's throwing this error.
If you need any more details, I would be happy to provide.
After a long talk with developer community of nuxtjs. Here is solution.
This problem occur when we try to run nuxt generate but our local nuxt version !== global nuxt version.
So solution is either update global nuxt version by npm i -g nuxt or run project from local nuxt version node_modules/.bin/nuxt generate

Yarn force a package to use a specific version

I currently have the the following issue when running a unit test using the Jest Vue cli plugin found here. https://www.npmjs.com/package/#vue/cli-plugin-unit-jest
Error I receive is Requires Babel "^7.0.0-0", but was loaded with "6.26.3". If you are sure you have a compatible version of #babel/core, it is likely that somet
hing in your build process is loading the wrong version. Inspect the stack trace of this error to look for the first entry that doesn't mention "#
babel/core" or "babel-core" to see what is calling Babel
I am using Yarn workspaces and would like to know the best way to force #vue/cli-plugin-unit-jest to use babel-core of version ^7.0.0-0

Vue Material postinstall failed

So I've been working on a Vue.js project for couple times now, and I am facing a problem I've never seen before.
Trying to git pull the project on another computer, or even downloading the project as a zip file, when it's time to npm install, vue-material module fails and the whole thing cannot be run.
It goes this way, with vie-material :
vue-material#1.0.0 postinstall C:\<my_things>\node_modules\vue-material
sh build/git-hooks/install.sh
Then I see this :
/usr/bin/bash: build/git-hooks/install.sh: No such file or directory
Then the modules' tree shows in the terminal, and at the end, I can see all the errors related to vue-material, with this statement :
Tell the author that this fails on your system:
sh build/git-hooks/install.sh
By the way, I tried to crate a brand new Vue project, and tried to add vue-material inside, no problem, so it has to do with my project.
Obviously though, /usr/bin/bash does not exist, since I'm running Windows 10.
Any knowledge on npm's installing routine ? I'm out of solution to try...
Can you share your package.json file?
I had this same problem just now and found that NPM could possibly be installing the incorrect version. Where I had "^vue-material": "1.0.0-beta-7" NPM was installing version 1.0.0 instead of 1.0.0-beta-7. If you remove the ^ then it may work for you. This is where I found the answer that helped me.
https://github.com/vuematerial/vue-material/issues/1155
Well, after couple times figuring out what was wrong, I got this :
I tried to use yarn and it told me that my node version was too old (vue-material needed 7.0+ and my node was 6.9, or at least that is what yarn told me), so I got myself the 8.9.3 node.
After this I tried to use yarn again, and the error with that bash script showed again.... then I just tried to use npm install again, and it worked just fine...
I don't know about the bash script thing, but one thing to remember is to always check for node and npm's version when errors happend.... (and yarn looks very cool and simple imo ^^).
You kinda made me think about a version problem though, I got you that ! :D
Problem solved....

How to install flow type correctly for react native#0.46+?

I've googled many sites but cannot found a tutorial that actually works for react-native + flow type.
There was flow installation guide from react-native#0.22 document, but it's gone in react-native#0.46.
However, it comes up again in Running Tests and Contributing, I tested to run npm run flow but not working, and yet it doesn't say how to make it works. It's possibly been a missing part inside of react-native documentation.
What I need is to run flow correctly with react-native. Auto-check flow every time I reload the page with ⌘R would be the best.
I just finished covering half of our project by flow and we use RN 0.44.0.
The tricky part is: do you also want to know errors inside node_modules, someone says those errors are helpful.
Anyway, I disable the error in node_modules, and here is my .flowconfig:
[ignore]
<PROJECT_ROOT>/node_modules/.*
<PROJECT_ROOT>/flowLibs.js
.....
[include]
[libs]
./flowLibs.js
.....
[lints]
[options]
You should install flow first if you not setup correctly,
npm install --save-dev flow-bin
and also run this in you project root after install:
npm run flow init
If npm run flow init does not work, just add "flow": "flow" in npm scripts.
After init, put my .flowconfig in your project .flowconfig file.
Then create a js file flowLibs.js and if npm run flow check cause your any error like Module_Name. Required module not found
Write down code in flowLibs.js:
declare module 'Module_Name' { declare var exports: any; };
After that, you should be good to go with you project now.
BTW, don't forget add //#flow on the top of the file which you want to check type.
I found flowtype is built in with react-native#0.46+.
For react-native document, I think they should at least tell flowtype is already built in. And for the rest document ex: Testing Your Changes#flow, it won't work without flow-bin, they should mention that too.
To make flowtype of best use, I use it with Visual Studio Code.
Steps:
Install flow-bin globally, by npm i flow-bin -g.
Make sure your terminal is responsive to command flow.
Install vscode flow extension.
Set vscode workspace preference with "javascript.validate.enable": false, to disable default javascript validation, so flow validation can take place.
To access vscode preference, ALT+F,P,S for windows, ⌘+, for mac.
then you have flowtype installed with visual result with every key stroke:
Try this one:
Adding Flow to React Native
https://medium.com/react-native-training/getting-started-with-react-native-and-flow-d40f55746809
Hope this helps!