I'm developing a node.js application on a 64bit Ubuntu machine that I intend to run on a Raspberry Pi running Rasbpian. The Pi is not usually connected to the internet, so I manually copy the project folder to its SD card. I can't run the application there since one of the required modules, epoll, apparently only works with 64 bit:
Error: /home/pi/bla/node_modules/epoll/build/Release/epoll.node: wrong
ELF class: ELFCLASS64
at Object.Module._extensions..node (module.js:602:18)
at Module.load (module.js:507:32) at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)
at Module.require (module.js:517:17)
at require (internal/module.js:11:18)
at bindings (/home/pi/bla/node_modules/bindings/bindings.js:76:44)
at Object. (/home/pi/bla/node_modules/epoll/epoll.js:1:99)
at Module._compile (module.js:573:30)
at Object.Module._extensions..js (module.js:584:10)
This can be fixed by running npm uninstall epoll and then npm install epoll, but only when the Pi is connected to the internet. Of course I could just not copy this specific module, but is there a way to avoid this error otherwise?
The problem isn't anything to do with copying, it's because your trying to run packages that have been compiled using a 64-bit Node version under a 32-bit version.
Compile your packages using the same bitness of Node on your Ubuntu system (you can install 32-bit Node on a 64-bit OS) and then copy them over.
If you have no internet connection on install, then the only way is to prepare both 32bit and 64bit node_modules beforehand. On first launch, just check your CPU and make node_modules symlink to node_modules_64 or node_modules_32.
Related
I am building an desktop app using Angular 7 and Electron 7. I need to read connected USB device details. To be specific I need to read connected USB barcode scanner serial number.
Debian version of my app is working perfectly with below code:
var HID = require('node-hid');
var devices = HID.devices();
console.log(devices);
When I try this same code in Win32 version of my app, it generates this below error:
tmp.node is not a valid Win32 application
..\resources\app.asar\node_modules\express\lib\application.js:630 Error:
..\AppData\Local\Temp\95434314-b7bd-4c9a-8413-b9c602346bd1.tmp.node is not a valid Win32 application.
..\AppData\Local\Temp\95434314-b7bd-4c9a-8413-b9c602346bd1.tmp.node
at process.func [as dlopen] (electron/js2c/asar.js:155:31)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:881:18)
at Object.func [as .node] (electron/js2c/asar.js:164:18)
at Module.load (internal/modules/cjs/loader.js:701:32)
at tryModuleLoad (internal/modules/cjs/loader.js:633:12)
at Function.Module._load (internal/modules/cjs/loader.js:625:3)
at Module.require (internal/modules/cjs/loader.js:739:19)
at require (internal/modules/cjs/helpers.js:14:16)
at bindings (..\AppData\Local\retailpos\app-1.0.0\resources\app.asar\node_modules\bindings\bindings.js:112:48)
at loadBinding (..\AppData\Local\retailpos\app-1.0.0\resources\app.asar\node_modules\node-hid\nodehid.js:25:42)
I am looking for a solve more than a week now. Can't find any solved answer.
I have checked that electron-rebuild is working properly.
Angular: 7.*
NPM: 6.13.1
Node: 12.12.1
Electron: 7.1.2
node-hid: 1.0.0
This issue has been solved when I created a Windows Build from a windows system. According to my understanding - Cross origin OS build was generating that issue.
I'm using trying to run nodeJs (node v 8.8.1) automated tests on Amazon Linux with Firefox. Due to some limitations with Amazon Linux, the latest version of firefox taht will actually run is 41. Below are my Firefox and Amazon versions ...
[myuser#mymachine ~]$ firefox -v
Mozilla Firefox 41.0
[myuser#mymachine ~]$ uname -a
Linux ip-33-22-3-77 4.9.51-10.52.amzn1.x86_64 #1 SMP Fri Sep 29 01:16:19 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
My question is, what version of Geckodriver do I use taht is compatible with this version of Firefox? With the latest version we get errors trying to spawn a Firefox window and without a gecko driver in our path, we get teh error
/home/jboss/node_modules/selenium-webdriver/firefox/index.js:354
throw Error(
^
Error: The geckodriver executable could not be found on the current PATH. Please download the latest version from https://github.com/mozilla/geckodriver/releases/ and ensure it can be found on your PATH.
at findGeckoDriver (/home/jboss/node_modules/selenium-webdriver/firefox/index.js:354:11)
at new ServiceBuilder (/home/jboss/node_modules/selenium-webdriver/firefox/index.js:446:22)
at Function.createSession (/home/jboss/node_modules/selenium-webdriver/firefox/index.js:516:21)
at createDriver (/home/jboss/node_modules/selenium-webdriver/index.js:170:33)
at Builder.build (/home/jboss/node_modules/selenium-webdriver/index.js:645:16)
at Object.<anonymous> (/home/jboss/.jenkins/workspace/subco/automated-tests/nodejs/js/js-FF/driver.js:9:73)
at Module._compile (module.js:612:30)
at Object.Module._extensions..js (module.js:623:10)
at Module.load (module.js:531:32)
at tryModuleLoad (module.js:494:12)
/home/jboss/node_modules/selenium-webdriver/firefox/index.js:354
throw Error(
^
Error: The geckodriver executable could not be found on the current PATH. Please download the latest version from https://github.com/mozilla/geckodriver/releases/ and ensure it can be found on your PATH.
at findGeckoDriver (/home/jboss/node_modules/selenium-webdriver/firefox/index.js:354:11)
at new ServiceBuilder (/home/jboss/node_modules/selenium-webdriver/firefox/index.js:446:22)
at Function.createSession (/home/jboss/node_modules/selenium-webdriver/firefox/index.js:516:21)
at createDriver (/home/jboss/node_modules/selenium-webdriver/index.js:170:33)
at Builder.build (/home/jboss/node_modules/selenium-webdriver/index.js:645:16)
at Object.<anonymous> (/home/jboss/.jenkins/workspace/subco/automated-tests/nodejs/js/js-FF/driver.js:9:73)
at Module._compile (module.js:612:30)
at Object.Module._extensions..js (module.js:623:10)
at Module.load (module.js:531:32)
at tryModuleLoad (module.js:494:12)
/home/jboss/node_modules/selenium-webdriver/firefox/index.js:354
throw Error(
^
Error: The geckodriver executable could not be found on the current PATH. Please download the latest version from https://github.com/mozilla/geckodriver/releases/ and ensure it can be found on your PATH.
at findGeckoDriver (/home/jboss/node_modules/selenium-webdriver/firefox/index.js:354:11)
at new ServiceBuilder (/home/jboss/node_modules/selenium-webdriver/firefox/index.js:446:22)
at Function.createSession (/home/jboss/node_modules/selenium-webdriver/firefox/index.js:516:21)
at createDriver (/home/jboss/node_modules/selenium-webdriver/index.js:170:33)
at Builder.build (/home/jboss/node_modules/selenium-webdriver/index.js:645:16)
at Object.<anonymous> (/home/jboss/.jenkins/workspace/subco/automated-tests/nodejs/js/js-FF/driver.js:9:73)
at Module._compile (module.js:612:30)
at Object.Module._extensions..js (module.js:623:10)
at Module.load (module.js:531:32)
at tryModuleLoad (module.js:494:12)
/home/jboss/node_modules/selenium-webdriver/firefox/index.js:354
throw Error(
^
Error: The geckodriver executable could not be found on the current PATH. Please download the latest version from https://github.com/mozilla/geckodriver/releases/ and ensure it can be found on your PATH.
at findGeckoDriver (/home/jboss/node_modules/selenium-webdriver/firefox/index.js:354:11)
at new ServiceBuilder (/home/jboss/node_modules/selenium-webdriver/firefox/index.js:446:22)
at Function.createSession (/home/jboss/node_modules/selenium-webdriver/firefox/index.js:516:21)
at createDriver (/home/jboss/node_modules/selenium-webdriver/index.js:170:33)
at Builder.build (/home/jboss/node_modules/selenium-webdriver/index.js:645:16)
at Object.<anonymous> (/home/jboss/.jenkins/workspace/subco/automated-tests/nodejs/js/js-FF/driver.js:9:73)
at Module._compile (module.js:612:30)
at Object.Module._extensions..js (module.js:623:10)
at Module.load (module.js:531:32)
at tryModuleLoad (module.js:494:12)
ERROR: Maven JVM terminated unexpectedly with exit code 137
Edit: Per the answer, I removed and re-installed teh Selenium 2.53 driver ...
npm uninstall selenium-webdriver
npm install selenium-webdriver#2.53
but now I'm getting a new error ...
Error: The wires executable could not be found on the current PATH. Please download the latest version from https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver and ensure it can be found on your PATH.
at findWires (/home/jboss/node_modules/selenium-webdriver/firefox/index.js:261:11)
at createWiresService (/home/jboss/node_modules/selenium-webdriver/firefox/index.js:285:15)
at new Driver (/home/jboss/node_modules/selenium-webdriver/firefox/index.js:355:21)
at Builder.build (/home/jboss/node_modules/selenium-webdriver/builder.js:467:16)
at Object.<anonymous> (/home/jboss/.jenkins/workspace/subco/automated-tests/nodejs/js/js-FF/driver.js:9:73)
at Module._compile (module.js:612:30)
at Object.Module._extensions..js (module.js:623:10)
at Module.load (module.js:531:32)
at tryModuleLoad (module.js:494:12)
at Function.Module._load (module.js:486:3)
/home/jboss/node_modules/selenium-webdriver/firefox/index.js:261
As firefox version is 41, good to use selenium 2, if we use selenium 3 means latest, we need gecko which will not support this old version.
I am using selenium 2 as has firefox dependency http://selenium-release.storage.googleapis.com/index.html?path=2.53/ with latest chrome and IE drivers to work with latest chrome and IE browsers.
I think, you are getting that error because it is asking for geckodriver.exe . Geckodriver was originally called wires before version 0.8.0. Please provide exe on your system PATH.
You can use selenium 3 (which I think is the best option, because its latest) without providing gecko ( earlier FF versions) by setting this property to false
System.setProperty("webdriver.firefox.marionette", "false");
or do
FirefoxOptions options = new FirefoxOptions()
.setLegacy(true);
You may have to look for nodejs equivalent.
EDIT: here is the js version
let options = new firefox.Options().useGeckoDriver(false);
When you do above, FF will use its legacy extension instead of gecko
as mentioned here
You can have a look at a related question here, if you are curious to know more about marionette client-server-gecko interaction.
Turns out the right version for Amazon Linux Firefox 41 is selenium-webdriver 2.50, no more no less (tried 2.48 and 2.53 and got failures with both of those).
I was working on a webapp and at some point VSCode decided to not make me work again.
Everything was working just fine. I have been developing and debugging on my local machine until yesterday night.
Then I went home.
Then this morning, when I started the debugger on VSCode, nothing will run, and instead an Exception was thrown.
Here is what was reported:
TypeError: Cannot convert object to primitive value
at c:\Users\myusername\workspace\checkinwebbackend\node_modules\lodash-compat\internal\isHostObject.js:10:30
at Object.<anonymous> (c:\Users\myusername\workspace\checkinwebbackend\node_modules\lodash-compat\internal\isHostObject.js:19:2)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (c:\Users\myusername\workspace\checkinwebbackend\node_modules\lodash-compat\lang\isNative.js:2:20)
I literally did not do anything. Came to work. Started the project and bam, exception. Everything was working fine till yesterday night.
Things I tried to do:
Reboot, didn't work
There was a Windows update available. I installed it and rebooted. Didn't work.
Removed all my VSCode extensions. Didn't work.
This problem already happened to me a month ago. I couldn't figure out what the problem was. I ended up formatting the PC and using Visual Studio Code Insiders.
What should I look for to solve this problem?
My environment:
Windows 10 Pro 64bit
Node v8.1.0
VSCode 1.18.0 Insider x64
I am trying to install ifx_db (Node module to connect to informix DB). It is working fine in Windows but in Linux i am getting the following error.
/app/node_modules/ifx_db/node_modules/bindings/bindings.js:88
throw e
^
Error: libthcli.so: cannot open shared object file: No such file or directory
at Error (native)
at Object.Module._extensions..node (module.js:597:18)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at bindings (/app/node_modules/ifx_db/node_modules/bindings/bindings.js:81:44)
at Object.<anonymous> (/app/node_modules/ifx_db/lib/odbc.js:29:31)
at Module._compile (module.js:570:32)
Request your inputs towards this
Thanks in advance
FYI:
The Informix node.js drive is depended on Informix Client SDK version 4.10 xC2 or above, that you need to download and install it separately. You may pick the latest version which is Informix CSDK 4.10xC9.
The ifx_db will be a read only repository for historic reference, OpenInformix is the new home; the URL for the Informix node.js driver is
https://github.com/OpenInformix/IfxNode
The Informix node.js from OpenInformix can be installed by
npm install ifxnjs
When installing Power Bi developer tool I get the following error:
let exec = require('child_process').execSync;
^^^
SyntaxError: Unexpected strict mode reserved word
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
The time that error message is taken I'm running NodeJS V4.4.7, but I have also tried with versions V5.5.0 and the latest version also. We have it working on another machine but can't seem to run the tool on mine. I am running as Admin.
The setup steps I'm following are from Power BI, here
Have you confirmed the node version with node -v?
I have just installed powerbi-visuals-tools. The node version is v0.12.x and I got the exact same error as yours.
After upgrading node to v6.9.4, the issue is solved. Please make sure you update node using the same method as before.