I am trying to use robotjs in my electron on a mips based Ubuntu. Since electron has mips linux version only up to version 1.8.8 (after that, no support), so I download this 1.8.8 electron-mips version. Then, I need to install Node, by checking the node version inside electron 1.8.8, I found it is node8.2.1, so I download this version source code and compile it in my mips platform, seems OK, and node and npm can run successfully. After this, I install libxtst-dev libpng++-dev, and then download the source code from robotjs homepage and unzip it in my directory, and under this directory, "npm install nan".
Then, I follow the robotjs homepage and try to compile it for my platform with command like:
node-gyp rebuild --runtime=electron --target=1.8.8 --disturl=https://atom.io/download/atom-shell --abi=57
During compiling, it always reports error(robotjs.cc, line 159): no matching function for call to v8::String::Utf8Value bstr(...).
And the same error occurs for line 447 and 486.
I checked the line 159/447/486 in robotjs.cc, they are as follows:
159: v8::String::Utf8Value bstr(v8::Isolate::GetCurrent(), Nan::To<v8::String>(info[0]).ToLocalChecked());
447: v8::String::Utf8Value fstr(v8::Isolate::GetCurrent(), Nan::To<v8::String>(value).ToLocalChecked());
486: v8::String::Utf8Value kstr(v8::Isolate::GetCurrent(), Nan::To<v8::String>(info[0]).ToLocalChecked());*
Anyone knows what's wrong with this, how should I do? thanks a lot!!
The current version of robotjs will not support anything earlier than 10.16.0
You'll need to go back to this commit and (I may have went a couple of commits too far) to get this to work. https://github.com/octalmage/robotjs/commit/b26c7ee0e3dd05420370350e540c48ae9d38f06c
Related
Issue: I cannot install any libraries using Haxe. Purpose: I want to install HaxeFlixel.
(Note: I am a newbie when it comes to using the command prompt for installing files, and it was run as administrator).
I have installed haxe 4.0.2 (with neko), located in C:\HaxeToolkit (seems to be Haxe 3.4.0 instead).
> haxelib returns usage info options.
> haxelib install all returns,
No hxml files found in the current directory. Seems like I'm missing files.
> haxelib install flixel returns
Error: Failed with error: X509 - Certificate verification failed, e.g. CRL, CA or signature check failed.
I also tried installing a different version of Haxe that is compatible with a specific version of Flixel. Unfortunately the same error appears and more.
downloaded Flixel 4.6.3 (It's haxelib.json file says "releasenote": "Compatibility with Haxe 4.0.0-rc.3").
uninstalled Haxe 4.0.2 and downloaded and installed Haxe 4.0.0-rc.3 (seems to be Haxe 3.4.0 instead, again)
placed Flixel folder in HaxeToolkit\haxe.
> haxelib install flixel returns
Error: haxelib Repository C:/WINDOWS/system32/flixel does not exist. Please run `haxelib setup` again.
Called from haxelib/client/Main.hx line 1149
Called from haxelib/client/Main.hx line 1143
Called from haxelib/client/Main.hx line 1672
Called from haxelib/client/Main.hx line 467
> haxelib setup returns
Please enter haxelib repository path with write access
> C:/WINDOWS/HaxeToolkit returns
haxelib repository is now C:\WINDOWS\HaxeToolkit
> haxelib install flixel returns
Error: X509 - Certificate verification failed, e.g. CRL, CA or signature check failed
Called from haxe/remoting/HttpConnection.hx line 63
Called from C:\projects\haxe\std/sys/Http.hx line 58
Called from C:\projects\haxe\std/sys/Http.hx line 245
Called from C:\projects\haxe\std/sys/Http.hx line 60
Called from haxe/remoting/HttpConnection.hx line 64
Called from haxelib/client/Main.hx line 51
Called from haxelib/client/Main.hx line 721
Called from haxelib/client/Main.hx line 470
Again flixel did not install.
Any help to clarify what might be going wrong is appreciated.
First off, Flixel is compatible with the latest stable Haxe release 4.0.5, so you shouldn't downgrade to an older version.
It sounds like you installed Haxe to C:/WINDOWS/HaxeToolkit? I'm not sure that's a good idea, since C:\WINDOWS is a system folder. Also, haxelib setup should probably not point to the HaxeToolkit folder directly - by defalt it uses a lib subfolder (C:\HaxeToolkit\haxe\lib\).
All that being said, to work around the haxelib install issues, you could download the libraries you need as .zip files from the Haxelib website, e.g. https://lib.haxe.org/p/flixel/ for Flixel:
You can then run haxelib install on the file (first switch to your Downloads folder with cd):
>haxelib install "flixel-4,6,3.zip"
Installing flixel...
Current version is now 4.6.3
Done
You would have to do this for all libraries that you need (openfl, lime, possibly flixel-addons, flixel-templates and flixel-tools).
I'm writing a Visual Studio Code extension which uses a native node.js module. When I try to debug this extension in vscode I get the error message from above, when loading the native module (when commenting out the require() call no error comes up). It tried quite a few steps to overcome + test this:
npm uninstall native-module followed by a npm install native-module --save-dev in my vscode extension folder, this compiled the native module completely and without problems.
Completely cleaned my node_modules folder in the extension and did again the npm install --save-dev.
Installed node.js again, both LTS and current. With LTS the error message changes to: expected 47, got 46.
Installed latest vscode (August recovery build)
Launched a node session in my vscode extension folder and loaded my native module. This works nicely.
Read the various questions and comments here on SO. They mostly recommend what I described above.
Still, I cannot get vscode to accept my native module. What can I do? From the above steps it appears as if vscode has been built with a node.js version between current and LTS. Can I force my native module somehow to use a specific version?
Btw. what do those numbers 48, 47, 46 etc. actually mean? The node.js version is of course in the typical form: major.minor.build and nothing of that matches the above version numbers.
Update:
ok, I found what those numbers mean: https://nodejs.org/en/download/releases/
Once you know what those numbers in the error message mean it's easy to solve the issue. Simply install the node.js version that is expected. In my case it's node.js 5.12.0.
Remove node_modules folder
Run npm update
Then;
Run npm install
I'm new to Electron, and I really love it so far, but I'm unable to package any of mine apps, at first I thought that it's maybe something related to my code, then I download "https://github.com/atom/electron-quick-start" run npm install and then I run "electron-packager . FooBar --platform=darwin --arch=x64 --version=0.28.2" it build the app but when I try to open it I get
so I didn't touch any code from the example, just wanted to build it and I got an error, what am I doing wrong? Thanks!
The versions of electron are moving very very fast.
And some times, they don't respect the "old" ways to do things (for example, declaring the app).
I advise you to not use the 0.28.2 version of electron but the most recent one.
It is very likely that the version of electron-prebuilt you are using to develop is much much much more recent than the 0.28.2 version. So, you are developing with something much newer, and then you are building with 0.28.2. This would cause the exact error that you are seeing, as older versions may not have had the electron module, which your code explicitly is importing. So... that is my suggestion. Change the version in your electron-packager command from 0.28.2 to something like 0.36.0. See if that works. Or better yet, use the same version as electron-prebuilt in your package.json.
This could be a combination of factors.
First, as others stated, the version of electron that you have might be newer than the one referenced in your build command. Locate the 'electron_prebuilt' folder inside your 'node_modules' folder, and examine the package.json file and make sure the version # is the same as what you are declaring in your build command.
If they are the same, then the issue might be that you have another version of electron on your computer that node is trying to use. If you installed electron via the -g option (global), check your home folder to see if there is another different version of electron. If you find one, either delete it or rename the 'electron_prebuilt' folder you find to something else. Try your build command again, and it should work now that you've eliminated the other versions of electron_prebuilt on your computer that node was referencing.
What worked for me was to move the "electron" module from "dev-dependencies" to "dependencies" in package.json. Try this and see if it works.
I've seen similar questions but no real solution that worked for me yet (most users just reinstall fibers or meteor (I'm not using meteor)).
I've added the nodejs module Sync to my nodejs 0.12.6 project. It's dependency is the Fibers module that got installed automatically with Sync. Now I wanted to load Sync via require, but it fails with the message
... /win32-x64-v8-4.3/fibers.node not found
And it's correct: In sync/node_modules/fibers/bin/ is no directory named win32-x64-v8-4.3, only win32-x64-v8-4.2 and renaming didn't solve the problem (would have been too easy)... 🙈
How can I solve this problem? How can this happen?
What is the meaning of the last number (4.3)? I guess it's windows, 64bit, Javascript v8 engine, and then? Fibers version?
Any ideas or hints?
Update:
I tried to updgrade node to 0.12.6, but nothing changed.
I found out what the 4.3 is about, it's the v8 version. Well, when running my application with electron, it is v8: '4.3.61.21'. When checking the version with node, it is 3.28. So it's maybe electrons "fault"?
Update #2:
Okay i found out that electron is based on io.js and not node. That explains the different v8 versions. But still no solution. When installing fibers with latest io.js (2.3.3), it tests the 4.2 binary, but electron requires 4.3 :(
Update #3:
Even with the same io.js version 2.3.1 as electron, it does only install the 4.2 binary.
Update #4:
Now, I've tried all three ways described at http://electron.atom.io/docs/v0.27.0/tutorial/using-native-node-modules/ (with electron version 0.29.1) - still no solution. There aren't any binaries for v8-4.3, still only the v8-4.2 ones. :(
Solution:
See my answer below. :)
At the end, i had to compile fibers on my own. As described in Update #4, i've tried it before. But node-gyp always failed and i didn't notice that i have to link to the new binary file on my own...
cd ~/my-project-root/
npm install sync
cd ./node_modules/sync/node_modules/fibers
node-gyp configure
HOME=~/.electron-gyp node-gyp rebuild --target=0.29.1 --arch=x64 --dist-url=https://atom.io/download/atom-shell
Then i've created the missing directory and moved the new binary there:
mkdir bin/win32-x64-v8-4.3
mv build/Release/fibers.node bin/win32-x64-v8-4.3/fibers.node
Now Sync works like a charm.
You need to use the electron-rebuild tool to rebuild your native module against the version of Electron you're using
I am using windows and when I took reference to download node js from here. When I write this line
C:> cinst nodejs.install -Version 0.6.10
in CMD it gives an error
C:>cinst nodejs.install -Version 0.6.10
'cinst' is not recognized as an internal or external command,
operable program or batch file.
I don't know how to install node js.I also have a question that if I install node js version say v0.10.26 will the programs made with previous versions(say 0.9) will work on 0.10
That error means that your cmd session can't find cinst. To use cinst, you have to install the package manager from http://chocolatey.org/
If you just want to get Node.js running though, there's a Windows installer at http://nodejs.org/download/ or you can just hit the big green Install button at http://nodejs.org/
Summarizing comments:
All of the versions are maintained and available under http://nodejs.org/dist/, 0.6.10 can be found at: http://nodejs.org/dist/v0.6.10/ and you can get the Windows installer by downloading the .msi file.
As for whether there might be breaking changes from version to version, most code moves forward just fine, but testing is always a good idea. Some packages will specify a specific version in their package.json file, but most will just request a version greater than a certain point in the engines element like:
{ "engines" : { "node" : ">=0.6.10" } }