[ANNOUNCE]node-red-contrib-xterm : second beta (sidebar)

Also, when I run npm (for example installing a node) I get the message;
npm WARN xterm-addon-fit@0.3.0 requires a peer of xterm@^4.0.0 but none is installed. You must install peer dependencies yourself.

I see it was reported earlier - [ANNOUNCE]node-red-contrib-xterm : second beta (sidebar)

Hi Paul,

I'm back and my interest in Node-RED finally has made a comeback. So slowly getting back into business...

That was a result of my last change. I had replaced all the http GET's by PUT's, but I had forgotten to update the Terminal-In node. How stupid of my. There is a small fix on Github that should solve the problem...

If I'm not mistaken, I cannot get around it. But it is NO problem in our case!
I have explained it on my readme page in case anybody else is wondering what it means:

Sorry, I'm afraid not, I can't even start xterm now (or load my flow) as I'm getting a 404 in the browser toolkit, even when using a incognito browser. I have restarted node-RED.

Paul has done a lot of test work, but the xterm node doesn't work anymore in his system :woozy_face:
For me it works fine. Would be nice if anybody else could install the latest version from Github and test it. Then at least I know if it is a general problem, or a specific use case ...
Thanks !!!

Just for info, I'm using;

  • Script installed Node-RED version: v1.0.3 on Raspberry Pi 3B+
  • Node.js version: v12.14.0
  • Served over SSH & requireHttps: true,
  • Editor & Admin API secured using AdminAuth
  • HTTP endpoints secured using httpNodeAuth

Installing xterm stops the flow from loading, and I get the browser error;

No errors (even at trace level) in the node-RED log.

Paul: if Iā€™ve the energy today Iā€™ll recreate this setup, see what I can find.
Bart: good to see you back up and running, hope youā€™re doing okay

1 Like

Morning Lena,
Yes, I'm getting up and running again :wink: Not at full speed yet, but almost there ...
Nice to see you joining the discussion.
Remark: this morning I have replaced the "static" in my route by "lib", since I wanted to avoid that we had a similar issue like the one with the SVG node that you solved. You never know ...

Lena,
It must be something different now.
Paul has been so kind again to add a console statement to the endpoint:

RED.httpAdmin.get('/xterm_shell/lib/:filename', function(req, res) {
   console.log("Getting file "+req.params.filename);
   ...
}

And then he sees this in his console log:

Getting fil> e xterm.js
Getting file xterm-addon-fit.js

So the error must be inside my endpoint. Will have to ask Paul to add some extra logging I'm afraid ...

2 Likes

Okay, humour me for a moment before I dive through the xterm sources. Where are xterm.js and xterm-addon-fit.js, as well as xterm.css located relatively to the node-red user dir?
Looking at the source you linked I'm seeing you use res.sendFile without options, so there's no root directory set. Express 4.x - API Reference

So if it won't be able to find that path, res.sendFile will likely give a 404 error too.

Hi Lena,
A few minutes ago I got some extra info from Paul, who has added some console statements. It seems there is a bug in my code that determines the path to the xterm library files.

On my raspberry the xterm library is installed by npm in:

/home/pi/.node-red/node_modules/xterm/lib/xterm.js

However on Paul's system it is installed by npm in:

/home/pi/node-red-contrib-xterm/node_modules/xterm/lib/xterm.js

If I remember correctly, older versions of npm did install the dependencies in subfolders of the current module, but now they are installed in the same folder as the current module.

Summarized: my code finds correctly where npm has installed the xterm library files, but then my code messes up the path. Will need to fix that today...

So you won't have to waste your time anymore on this issue.
I appreciate your help very much !!!!!!!! Thanks !

In that case, take a look at Julian's code for uibuilder, specifically for the frontend library handling. He had to work around NPM too there, and either this is an issue he tackled too, or an issue not yet discovered.

So I have to ask how exactly is Paul installing the node - looks like he has copied it locally rather than npm installed it into the .node-red directory.

1 Like

Git cloning the node's repo into /home/pi
cd .node-red
npm install /home/pi/node-red-contrib-xterm

As per Creating your first node : Node-RED

I think we can safely say that it has been fixed by https://github.com/bartbutenaers/node-red-contrib-xterm/commit/dbddc8f8b87904d5dcc1019b4dd8d7b9fb36a50f :+1: :+1: :+1:

There are no error messages in the browser console or the node-RED log, and both xterm in the sidebar, and the associated xterm node work as intended.

Nice work Bart.

1 Like

Woehoe. Thank you lord!!!!
Finally the famous Paul-Reed is up-and-running. Champagne please :champagne:
Thanks a lot Paul for wasting your evenings testing over and over again ...

1 Like

Shouldn't that be 'infamous' ??

1 Like

Not anymore :wink:
When I haven't received any new issues within the next 7 days, then I will publish the xterm node on NPM. The countdown has started ...

3 Likes

The 7 days have passed ...

image

7 Likes

This is quite nice, thank you @BartButenaers !

2 Likes