Need a Geany (Thanksgiving) Miracle  [Solved]

Message
Author
User avatar
operadude
Posts: 1044
Joined: Tue Nov 05, 2019 12:08 am

Need a Geany (Thanksgiving) Miracle

#1 Post by operadude »

A Happy One to All :exclamation:

Having an issue with Geany (IDE), specifically running JavaScript.

First, my QSI:

Code: Select all

Snapshot created on: 20231012_1725
System:
  Kernel: 6.1.0-13-amd64 [6.1.55-1] arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
    parameters: BOOT_IMAGE=/boot/vmlinuz-6.1.0-13-amd64 root=UUID=<filter> ro quiet splash
  Desktop: Xfce v: 4.18.1 tk: Gtk v: 3.24.36 info: xfce4-panel, plank wm: xfwm v: 4.18.0 vt: 7
    dm: LightDM v: 1.26.0 Distro: MX-23 - Xfce_x64 Libretto October 12  2023 base: Debian GNU/Linux
    12 (bookworm)
Machine:
  Type: Desktop System: Gigabyte product: H270-HD3 v: N/A serial: <superuser required>
  Mobo: Gigabyte model: H270-HD3-CF v: x.x serial: <superuser required> UEFI: American Megatrends
    v: F5 date: 04/24/2017
Battery:
  Device-1: hidpp_battery_0 model: Logitech Wireless Mouse PID:0080 serial: N/A
    charge: 55% (should be ignored) rechargeable: yes status: discharging
CPU:
  Info: model: Intel Core i3-7100 bits: 64 type: MT MCP arch: Kaby Lake gen: core 7 level: v3
    note: check built: 2018 process: Intel 14nm family: 6 model-id: 0x9E (158) stepping: 9
    microcode: 0x42
  Topology: cpus: 1x cores: 2 tpc: 2 threads: 4 smt: enabled cache: L1: 128 KiB
    desc: d-2x32 KiB; i-2x32 KiB L2: 512 KiB desc: 2x256 KiB L3: 3 MiB desc: 1x3 MiB
  Speed (MHz): avg: 800 min/max: 800/3900 scaling: driver: intel_pstate governor: powersave
    cores: 1: 800 2: 800 3: 800 4: 800 bogomips: 31199
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: gather_data_sampling status: Vulnerable: No microcode
  Type: itlb_multihit status: KVM: VMX disabled
  Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable
  Type: mds status: Vulnerable: Clear CPU buffers attempted, no microcode; SMT vulnerable
  Type: meltdown mitigation: PTI
  Type: mmio_stale_data status: Vulnerable: Clear CPU buffers attempted, no microcode; SMT
    vulnerable
  Type: retbleed status: Vulnerable
  Type: spec_rstack_overflow status: Not affected
  Type: spec_store_bypass status: Vulnerable
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 mitigation: Retpolines, STIBP: disabled, RSB filling, PBRSB-eIBRS: Not
    affected
  Type: srbds status: Vulnerable: No microcode
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: AMD Oland PRO [Radeon R7 240/340 / Radeon 520] vendor: Micro-Star MSI driver: radeon
    v: kernel alternate: amdgpu arch: GCN-1 code: Southern Islands process: TSMC 28nm built: 2011-20
    pcie: gen: 3 speed: 8 GT/s lanes: 8 ports: active: HDMI-A-1 empty: DVI-D-1,VGA-1
    bus-ID: 01:00.0 chip-ID: 1002:6613 class-ID: 0300 temp: 39.0 C
  Display: x11 server: X.Org v: 1.21.1.7 compositor: xfwm v: 4.18.0 driver: X: loaded: radeon
    unloaded: fbdev,modesetting,vesa dri: radeonsi gpu: radeon display-ID: :0.0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.00x11.22") s-diag: 582mm (22.93")
  Monitor-1: HDMI-A-1 mapped: HDMI-0 model: Samsung built: 2007 res: 1920x1080 hz: 60 dpi: 305
    gamma: 1.2 size: 160x90mm (6.3x3.54") diag: 184mm (7.2") ratio: 16:9 modes: max: 1920x1080
    min: 640x480
  API: OpenGL v: 4.5 Mesa 22.3.6 renderer: OLAND ( LLVM 15.0.6 DRM 2.50 6.1.0-13-amd64)
    direct-render: Yes
Audio:
  Device-1: Intel 200 Series PCH HD Audio vendor: Gigabyte driver: snd_hda_intel v: kernel
    bus-ID: 00:1f.3 chip-ID: 8086:a2f0 class-ID: 0403
  Device-2: AMD Oland/Hainan/Cape Verde/Pitcairn HDMI Audio [Radeon HD 7000 Series]
    vendor: Micro-Star MSI driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 8
    bus-ID: 01:00.1 chip-ID: 1002:aab0 class-ID: 0403
  API: ALSA v: k6.1.0-13-amd64 status: kernel-api tools: alsamixer,amixer
  Server-1: PipeWire v: 0.3.65 status: active with: 1: pipewire-pulse status: active
    2: wireplumber status: active 3: pipewire-alsa type: plugin 4: pw-jack type: plugin
    tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Device-1: Intel Ethernet I219-V vendor: Gigabyte driver: e1000e v: kernel port: N/A
    bus-ID: 00:1f.6 chip-ID: 8086:15b8 class-ID: 0200
  IF: eth0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  IF-ID-1: tun0 state: unknown speed: 10 Mbps duplex: full mac: N/A
Drives:
  Local Storage: total: 7.75 TiB used: 5.38 TiB (69.5%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung model: SSD 970 EVO 250GB size: 232.89 GiB
    block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter>
    rev: 1B2QEXE7 temp: 28.9 C scheme: GPT
  ID-2: /dev/sda maj-min: 8:0 model: SATA SSD size: 111.79 GiB block-size: physical: 512 B
    logical: 512 B speed: 6.0 Gb/s type: SSD serial: <filter> rev: 61.3 scheme: GPT
  ID-3: /dev/sdb maj-min: 8:16 vendor: Kingston model: SA400S37120G size: 111.79 GiB block-size:
    physical: 512 B logical: 512 B speed: 6.0 Gb/s type: SSD serial: <filter> rev: 61K1 scheme: MBR
  ID-4: /dev/sdc maj-min: 8:32 vendor: Seagate model: ST3000DM001-1ER166 size: 2.73 TiB
    block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s type: HDD rpm: 7200 serial: <filter>
    rev: CC25 scheme: GPT
  ID-5: /dev/sdd maj-min: 8:48 vendor: Toshiba model: DT01ACA050 size: 465.76 GiB block-size:
    physical: 4096 B logical: 512 B speed: 6.0 Gb/s type: HDD rpm: 7200 serial: <filter> rev: A750
    scheme: GPT
  ID-6: /dev/sde maj-min: 8:64 vendor: Western Digital model: WD5000AADS-00S9B0 size: 465.76 GiB
    block-size: physical: 512 B logical: 512 B speed: 3.0 Gb/s type: N/A serial: <filter> rev: 0A01
    scheme: GPT
  ID-7: /dev/sdf maj-min: 8:80 type: USB vendor: Seagate model: Expansion Desk size: 3.64 TiB
    block-size: physical: 4096 B logical: 4096 B type: N/A serial: <filter> rev: 0739 scheme: MBR
  ID-8: /dev/sdl maj-min: 8:176 type: USB model: Mass Storage Device size: 7.42 GiB block-size:
    physical: 512 B logical: 512 B type: N/A serial: <filter> rev: 1.00 scheme: MBR
  SMART Message: Unknown USB bridge. Flash drive/Unsupported enclosure?
  ID-9: /dev/sdm maj-min: 8:192 type: USB model: Storage Device size: 7.5 GiB block-size:
    physical: 512 B logical: 512 B type: N/A serial: N/A rev: 1.00 scheme: MBR
  SMART Message: Unknown USB bridge. Flash drive/Unsupported enclosure?
  ID-10: /dev/sdn maj-min: 8:208 type: USB model: Storage Device size: 3.69 GiB block-size:
    physical: 512 B logical: 512 B type: N/A serial: N/A rev: 1.00 scheme: MBR
  SMART Message: Unknown USB bridge. Flash drive/Unsupported enclosure?
  ID-11: /dev/sdo maj-min: 8:224 type: USB model: Storage Device size: 7.4 GiB block-size:
    physical: 512 B logical: 512 B type: N/A serial: N/A rev: 1.00 scheme: MBR
  SMART Message: Unknown USB bridge. Flash drive/Unsupported enclosure?
Partition:
  ID-1: / raw-size: 25 GiB size: 24.44 GiB (97.76%) used: 9.85 GiB (40.3%) fs: ext4
    dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-2: /boot/efi raw-size: 256 MiB size: 252 MiB (98.46%) used: 1.6 MiB (0.7%) fs: vfat
    dev: /dev/nvme0n1p1 maj-min: 259:1
  ID-3: /home raw-size: 25 GiB size: 24.44 GiB (97.76%) used: 9.71 GiB (39.7%) fs: ext4
    dev: /dev/nvme0n1p3 maj-min: 259:3
Swap:
  Kernel: swappiness: 15 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: partition size: 32 GiB used: 0 KiB (0.0%) priority: -2 dev: /dev/nvme0n1p10
    maj-min: 259:10
Sensors:
  System Temperatures: cpu: 37.0 C mobo: N/A gpu: radeon temp: 39.0 C
  Fan Speeds (RPM): N/A
Repos:
  Packages: pm: dpkg pkgs: 2367 libs: 1235 tools: apt,apt-get,aptitude,nala,synaptic pm: rpm
    pkgs: 0 pm: flatpak pkgs: 0
  No active apt repos in: /etc/apt/sources.list
  Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list
    1: deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
  Active apt repos in: /etc/apt/sources.list.d/debian.list
    1: deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
    2: deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
  Active apt repos in: /etc/apt/sources.list.d/mx.list
    1: deb http://mxrepo.com/mx/repo/ bookworm main non-free
  Active apt repos in: /etc/apt/sources.list.d/skype-stable.list
    1: deb [arch=amd64] https://repo.skype.com/deb stable main
Info:
  Processes: 293 Uptime: 6h 15m wakeups: 6 Memory: 31.3 GiB used: 3.19 GiB (10.2%) Init: SysVinit
  v: 3.06 runlevel: 5 default: graphical tool: systemctl Compilers: gcc: 12.2.0 alt: 12
  Client: shell wrapper v: 5.2.15-release inxi: 3.3.26
Boot Mode: UEFI
So, getting the same error for any JavaScript program that I try to run in Geany. Here's an example:

Code: Select all

console.log("javascript version =", js_version)
And here's the error I get (in terminal):

Code: Select all

/tmp/geany_run_script_EQBEE2.sh: 7: ./untitled2: not found


------------------
(program exited with code: 127)
Press return to continue
Same thing happens with any other code, such as:

Code: Select all

const num1 = 5;
const num2 = 3;

// add two numbers
const sum = num1 + num2;

// display the sum
console.log('The sum of ' + num1 + ' and ' + num2 + ' is: ' + sum);
And the following error:

Code: Select all

/tmp/geany_run_script_APAUE2.sh: 7: ./untitled: not found


------------------
(program exited with code: 127)
Press return to continue
I recall finding something similar when trying Python, and found that I had to change the "build commands" to read "python3....". I'm wondering if there's something similar that I need to change for JavaScript ???

Anyway, here are the (default) build-commands that I have in Geany (for JavaScript):
JavaScriptBuildCommands.png
Like I said: "I need a miracle"...

:pray:
You do not have the required permissions to view the files attached to this post.

User avatar
l0dr3
Posts: 463
Joined: Wed Jun 28, 2023 11:06 am

Re: Need a Geany (Thanksgiving) Miracle

#2 Post by l0dr3 »

Hi @operadude

You need a javascript interpreter or a browser to run javascript from geany IDE !

E.g.: for the setup, see: https://askubuntu.com/a/1312222

HTH, greetz l0dr3

User avatar
operadude
Posts: 1044
Joined: Tue Nov 05, 2019 12:08 am

Re: Need a Geany (Thanksgiving) Miracle

#3 Post by operadude »

l0dr3 wrote: Thu Nov 23, 2023 8:36 am Hi @operadude

You need a javascript interpreter or a browser to run javascript from geany IDE !

E.g.: for the setup, see: https://askubuntu.com/a/1312222

HTH, greetz l0dr3
Thanks for that, and I will check it out!

EDIT:

Yeah, I saw that already, didn't find it very helpful-- the quoted text a bit too ambiguous for me:
If we assume you already installed Node.js, you should be able to use node CLI tool to run JavaScript files.

In Geany (version 1.33), go to Build -> Set Build Commands. At top, you should see Javascript commands. Add the name as you want, then add node "%f" to the Command textbar .

Now from Build tab you can run your file by selecting your customized build option.
So, is it as simple as installing Node.js ?
Also, Not sure what is meant by:
Add the name as you want, then add node "%f" to the Command textbar .
Not sure what name to put, and in which box to put it in, or what it's even for!?!

Assuming that "Command textbar" means the "Execute" textbar at the bottom of build commands (?).

I can run other "scripting" language programs in Geany without having to jump through hoops.

:confused:

User avatar
l0dr3
Posts: 463
Joined: Wed Jun 28, 2023 11:06 am

Re: Need a Geany (Thanksgiving) Miracle

#4 Post by l0dr3 »

Sorry - i have no node.js installed on this box, heres an example (from geany running in windows - but same basic procedures in any other OS) ...
geany-build-commands.png
... for markdown-files (.md), i've setup a viewer command, where 'MarkdownViewer'' is the executable, that processes the .md-file of the selected geany-tab.

This custom-command appears in the geany gui at the top of the 'Build' menu as 'MDPreview' (and can be associated with a shortcut-key, 'F8' in my setup)

The default 'F5 - Run' shortcut-key or 'Build: Execute' option in geany only executes scripts for languages, the OS already knows and has an interpreter pre-installed
(e.g.: 'bash' for .sh, 'python3' for .py, ...)
You do not have the required permissions to view the files attached to this post.

User avatar
operadude
Posts: 1044
Joined: Tue Nov 05, 2019 12:08 am

Re: Need a Geany (Thanksgiving) Miracle

#5 Post by operadude »

@l0dr3 :

Will take a look.
Heading-Out for Festivities.

I am trying to run files with ".js" extensions.

Right now, just "untitled.js", etc.

Thanks for the follow-up!

EDIT:

The files I am trying to run are created WITHIN Geany, saved, and then using F5.

That's when I get the error....

User avatar
operadude
Posts: 1044
Joined: Tue Nov 05, 2019 12:08 am

Re: Need a Geany (Thanksgiving) Miracle

#6 Post by operadude »

May have found a hint as to why any JavaScript code is not executing in Geany:

First, verifying that my files DO exist:

Code: Select all

opera-dude@GA-H270-HD3:~/Documents
$ ls u*.js
untitled2.js  untitled.js
Next, here's the code within Geany, and note the Message Window at the bottom:
geany_01.png
Now, I select from the "Build" tab, and choose "Lint". See the output in the Message Window:
geany_02.png
It seems that I don't have "jshint", or, Geany can't find it!!!
As a reminder, "jshint" is part of the build commands for JavaScript (within Geany):
JavaScriptBuildCommands.png
I have tried

Code: Select all

$ sudo apt install geany-plugins
, but I don't see "jshint" listed, so I did not go through with that install.

Any thoughts about why "jshint" isn't working or being executed?

:confused:
You do not have the required permissions to view the files attached to this post.

User avatar
l0dr3
Posts: 463
Joined: Wed Jun 28, 2023 11:06 am

Re: Need a Geany (Thanksgiving) Miracle

#7 Post by l0dr3 »

but I don't see "jshint" listed, so I did not go through with that install.

Any thoughts about why "jshint" isn't working or being executed?
:confused: Do you have any js-runtime(s) installed at all ?

for reference, see ...
https://linuxize.com/post/how-to-instal ... debian-10/
https://www.thelinuxfaq.com/npm/npm-packages/jshint

greetz l0dr3

User avatar
operadude
Posts: 1044
Joined: Tue Nov 05, 2019 12:08 am

Re: Need a Geany (Thanksgiving) Miracle

#8 Post by operadude »

@l0dr3 :

Thanks for the follow-up!

How would I check:
:confused: Do you have any js-runtime(s) installed at all ?
I tried:

Code: Select all

$js-runtime
, and

Code: Select all

$which js-runtime
Both came-up empty.

Thanks for the links, but I am wary of having to install what look like huge packages.
I don't plan on using JavaScript to build anything right now; just familiarizing myself with the language. I was hoping to keep it all within Geany, without any large-ish addons or plugins, etc.

It seems odd to me that the Geany .config files support .javascript, and all the build commands are configured, but that I would then have to install another (what looks to me, a) huge package (Node.js and npm (Node Package Manager)).

Just trying to keep it simple... :pray:

Anyway...I really DO appreciate the time you are taking to answer my (JavaScript Noob) questions :exclamation:

:cool:

User avatar
l0dr3
Posts: 463
Joined: Wed Jun 28, 2023 11:06 am

Re: Need a Geany (Thanksgiving) Miracle

#9 Post by l0dr3 »

Here is a simple setup, i just created for geany WITHOUT the need for a nodejs installation.

Hint and background: every modern webbrowser is a JS-Interpreter ;)

Geany 'Set Build Commands' setup ...
Screenshot_2023-11-24_12-36-20.jpg
Now - from e.g.: https://www.w3schools.com/js/tryit.asp? ... _lightbulb ... copy and paste the (left-side) code example into geany ...
... save-as '~/Documents/geany-js-example.html'
... goto the w3schools example, on the right-side, copy/save-as 'pic_bulboff.gif' and 'pic_bulbon.gif' to '~/Documents'

Select in geany menu-bar 'Build|RunInFF' or: (just press F8) ...

... enjoy
:crossfingers:
Screenshot_2023-11-24_12-46-50.jpg
You do not have the required permissions to view the files attached to this post.

User avatar
operadude
Posts: 1044
Joined: Tue Nov 05, 2019 12:08 am

Re: Need a Geany (Thanksgiving) Miracle

#10 Post by operadude »

@l0dr3:

So, tried your fix, and, unfortunately, it's not giving me what I'm looking for.

Yes, Firefox opens, but simply prints the code; it does NOT execute the code.

When I add the JavaScript command, as you show:

Code: Select all

RunInFF    firefox %d/%f
and then press F8, this is what I get in my Firefox Browser:

Code: Select all

console.log("javascript version =", js_version)
What I want is the output generated by running the above code; not the code itself.

When I try to execute or run the code (button or F5), I get this:

Code: Select all

/tmp/geany_run_script_LC8CF2.sh: 7: ./untitled2: not found


------------------
(program exited with code: 127)
Press return to continue
Maybe this is a lost cause :frown:

I really don't want to have to install that huge Node.js (and npm) package, just to be able to try-out a few, very short, JavaScript (.js) programs within Geany.

Maybe I'll need a different editor. Was really hoping not to have to install Visual Studio Code, but maybe it'll be worth it in the long run.

:eek:

Post Reply

Return to “Software / Configuration”