How can I update Node.JS through JXCore? - node.js

I'm getting this error when trying to use the Steam API:
var cryptedSessKey = require('crypto').publicEncrypt(fs.readFileSync(__dirna
^
TypeError: Object # has no method 'publicEncrypt'
at SteamClient.handlers.(anonymous function) (/usr/local/psa/var/modules/jxcore-support/native_modules/node_modules/steam/lib/steam_client.js:150:42)
at SteamClient.netMsgReceived (/usr/local/psa/var/modules/jxcore-support/native_modules/node_modules/steam/lib/steam_client.js:106:26)
at Connection.emit (events.js:82:15)
at Connection._readPacket (/usr/local/psa/var/modules/jxcore-support/native_modules/node_modules/steam/lib/connection.js:50:8)
at Connection.emit (events.js:79:15)
at emitReadable (_stream_readable.js:383:10)
at emitReadable (_stream_readable.js:379:5)
at readableAddChunk (_stream_readable.js:143:31)
at Connection.Readable.push (_stream_readable.js:107:10)
at TCP.onread (net.js:489:18)
Spawner error: Application exited by itself with code: 8
Spawner info: Subscribing is delayed by 2000 ms.
Spawner info: Subscribed successfully: Successfully subscribed process 25525 to the monitor.
The fix is to apparently upgrade my node.js to version v0.12. As stated here: https://github.com/seishun/node-steam/issues/121
How can I do this? I'm using JXCore extension for Plesk.
I've tried SSHing in and running update commands but it doesn't seem to recognise node. Do I have to browse to a certain directory? I can't even run node --version because it's all within JXCore (I assume).
I have the lastest version of JXCore (Installed v Beta-0.3.0.2).
I'm assuming I'm just being an idiot somehow but I'm still new to node.js.
Can anyone help me?
Thank you
Jack

I asked the same question on their Github and this was their response:
JXcore v 0.3 is based on Node 0.10. AFAIK that module has node 0.10
compatible version too. You should use that. We are planning to bring
new crypto API from 0.12 soon.
Therefore, for now, you can't update it.

Related

aws-azure-login "Unable to recognize page state!"

I have trawled the net on this one and cannot find a resolution.
I have deployed an EC2 instance from a AWS RHEL 8 AMI.
I have installed all the pre-requisites for aws-azure-login but cannot connect to my accounts over SAML. (https://github.com/sportradar/aws-azure-login)
The config file has been created with parameters. When running aws-azure-login it returns the username, I press enter and then it hangs for minutes and returns the following error:
Unable to recognize page state! A screenshot has been dumped to aws-azure-login-unrecognized-state.png. If this problem persists, try running with --mode=gui or --mode=debug
After running in debug i get the following output:
Logging in with profile 'default'...
Using AWS SAML endpoint https://signin.aws.amazon.com/saml
Error: Failed to launch the browser process!
[13527:13527:1220/050718.762168:ERROR:browser_main_loop.cc(1409)] Unable to open X display.
TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
at onClose (/usr/lib/node_modules/aws-azure-login/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:197:20)
at Interface.<anonymous> (/usr/lib/node_modules/aws-azure-login/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:187:68)
at Interface.emit (events.js:412:35)
at Interface.emit (domain.js:475:12)
at Interface.close (readline.js:530:8)
at Socket.onend (readline.js:254:10)
at Socket.emit (events.js:412:35)
at Socket.emit (domain.js:475:12)
at endReadableNT (internal/streams/readable.js:1334:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
Node version = v14.18.2
Any pointers would be greatly appreciated.
Note: on Linux you will likely need to disable the Puppeteer sandbox
or Chrome will fail to launch:
aws-azure-login --no-sandbox
If not check Unable to open X display when trying to run google-chrome on Centos (Rhel 7.5)
I bumped into same issue on CentOS7
aws-azure-login --profile <profile_name> --no-prompt --no-sandbox --enable-chrome-network-service --no-verify-ssl
worked for me, hope I helped anyone
I was getting the same error but then I end up recreating a new profile name. This time, I made sure that my profile name was one word, all lower case, and only characters was used. Example: automation

**ERROR! Callback called multiple times** JHipster version 7.3.1 (latest) having Error in Node

I have used other versions of JHipster but that one in my mac is not working fine, I am trying to generate a simple gateway (no entities yet), and after executing:
$jhipster
Filling the application metadata, I just got:
ERROR! Callback called multiple times
Error [ERR_MULTIPLE_CALLBACK]: Callback called multiple times
at NodeError (node:internal/errors:371:5)
at onFinish (node:internal/streams/writable:667:37)
at processTicksAndRejections (node:internal/process/task_queues:82:21)
at runNextTicks (node:internal/process/task_queues:65:3)
at listOnTimeout (node:internal/timers:526:9)
at processTimers (node:internal/timers:500:7) {
code: 'ERR_MULTIPLE_CALLBACK'
So, according to #MattRaible and #GaelMariou, when having the ERROR! Callback called multiple times when generating JHipter applications or entities, you should verify the Node JS version. That version is provided in pom.xml or build.gradle, however, I never found a reference of node version in pom.xml (I use maven).
It is not clear where to get the exact version, nevertheless there is this article that states the same problem using node.js version bigger than 14: https://github.com/jhipster/generator-jhipster/issues/16744.
Meaning you should keep your node.js in version 14 until they solve that issue. I changed to v14.18.1, and now it is working sharp.

Errror which crashed the my hosted node.js server file which is run on fore erver command

My node.js server file which is hosted on a server is used by my various applications like mobile apps and desktop app.
At some time my server file which is run through forever command crashes and my whole front end system goes down. Why does the server file crash?
Type Error: Cannot read property 'fragmentedOperation' of null
at Receiver.endPacket (C:\Users\root\Desktop\Server\windowsnodefiles\node-v6.10.3-win-x64\node_modules\socket\node_modules\ws\lib\Receiver.js:247:18)
at Receiver.finish (C:\Users\root\Desktop\Server\windowsnodefiles\node-v6.10.3-win-x64\node_modules\socket.io\node_modules\ws\lib\Receiver.js:483:12)
at Receiver.<anonymous> (C:\Users\root\Desktop\Server\windowsnodefiles\node-v6.10.3-win-x64\node_modules\socket.io\node_modules\ws\lib\Receiver.js:451:33)
at Receiver.add (C:\Users\root\Desktop\Server\windowsnodefiles\node-v6.10.3-win-x64\node_modules\socket.io\node_modules\ws\lib\Receiver.js:95:24)
at Socket.realHandler (C:\Users\root\Desktop\Server\windowsnodefiles\node-v6.10.3-win-x64\node_modules\socket.io\node_modules\ws\lib\WebSocket.js:800:20)
at emit One (events.js:96:13)
at Socket.emit (events.js:188:7)
at readability (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at Nonreactive (net.js:547:20)
error: Forever detected script exited with code: 1
error: Script restart attempt #2
Error: %1 is not a valid Win32 application.
If you are using browserSync library then you can check this link
rollback the browserSync version to ^2.6.4 and it works
or try updating your socket.io package as per this link
Please check if your issue is fixed with the latest release

Node with Opa app crashes when trying to connect to unavailable CouchDB

I am working on Opa app using CouchDB as a database backend. When fetching a document with API function CouchDd.Document.get (API doc) and the DB server is down, my app crashed:
/opt/mlstate/lib/opa/stdlib/server.opp/serverNodeJsPackage.js:169
,(global.hasOwnProperty("toString") && global.toString || undefined)(e));}req.
^
TypeError: undefined is not a function
at ClientRequest.on_error (/opt/mlstate/lib/opa/stdlib/server.opp/serverNodeJsPackage.js:169:489)
at ClientRequest.EventEmitter.emit (events.js:88:17)
at Socket.socketErrorListener (http.js:1320:9)
at Socket.EventEmitter.emit (events.js:88:17)
at Socket._destroy.self.errorEmitted (net.js:329:14)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
and returns to shell prompt. I am running the app with ./myapp --nodb, because I do not use the build-in support for the MongoDB.
The CouchDb.Document.get function returns either {success: {FormatedJson: ...}} or {failure}. I expected that parsing the result for the {failure} is enough to catch all the network connection problems. What else should I do?
I am using Opa framework version 1.0.5 on OSX (11.4.0 Darwin) from the standard package on the Opa website, Node.js v0.8.3 and CouchDB 1.2.0.
This was a bug in 1.0.5, but it's been fixed already. You can get the sources for the fixed version here, but an official package hasn't been released yet.

RabbitMQ + Node.JS Connection issue, frame size too large?

I have been playing around with RabbitMQ with apache + php and wanted to see how it compared to Node.JS in performance.
Using the latest node.js (0.4.12) and amqp module (npm install amqp), i get a unknown exception connecting which it seems like it is the frame size causing error (line 181 in amqp.js), removing the error from the code just throws another related to allocating too large of an array size.
the RabbitMQ server is is just a "apt-get install rabbitmq-server" with default configuration. This works in PHP just fine.
Starting ... AMQP URL: amqp://localhost
events.js:47
throw new Error("Uncaught, unspecified 'error' event.");
^
Error: Uncaught, unspecified 'error' event.
at Connection.emit (events.js:47:15)
at AMQPParser.onError (/nodeJS_stuff/node_modules/amqp/amqp.js:839:12)
at AMQPParser.throwError (/nodeJS_stuff/node_modules/amqp/amqp.js:145:25)
at AMQPParser.execute (/nodeJS_stuff/node_modules/amqp/amqp.js:181:18)
at Connection.<anonymous> (/nodeJS_stuff/node_modules/amqp/amqp.js:851:12)
at Connection.emit (events.js:64:17)
at Connection._onReadable (net.js:672:14)
at IOWatcher.onReadable [as callback] (net.js:177:10)
Any one ever run into this? i have tried a couple examples and i always get this. i am running this on EC2 as well, if that helps any.
I just saw this problem today. It seemed to me like a mismatch between the versions of rabbitmq and amqp. I was testing two versions of node-amqp (0.0.2 and 0.1.0) and rabbitmq (1.7.2 and 2.3.1). I found out that node-amqp 0.0.2 works with both versions of rabbitmq, but the newer node-amqp (0.1.0, actually as of version 0.0.6) doesn't work with the older rabbitmq. So try rolling back your node-amqp to an older version and see if it works.
It is definitely a version mismatch between amqp and the installed version of RabbitMQ. The problem is most probably due to rabbitmq-server being too old. I had the exactly same problem on my Debian machine and the RabbitMQ installation guide pointed me to the right direction.
Uninstall your current version of rabbitmq-server and download the most recent one from the RabbitMQ website.

Resources