Xterm-application failed to launch on old Raspberry Pi B+


Hi, I’m trying to install @osjs/xterm-application to have a complete remote webtop access to my old Raspberry Pi B+.

First error I’ve encountered was during npm install of @osjs/xterm-application. It was depending node-pty version 0.7.8, which was depending on nan 2.10.0. But nan 2.10 was not compiling on my machine. I’ve read that it’s fixed on later versions. So I forked @osjs/xterm-application and changed dependency version of node-pty to 0.9.0, which depends on nan 2.14.0. It compiled and installed. Seemed nice.

I’ve made npm run package:discover, npm run build and npm run serve commands as documented. Jumped into web browser, clicked xterm app, but it failed to launch.

Package Loading 'Xterm' failed: /apps/Xterm/main.js, /apps/Xterm/main.css

Checked the browser console, here is the message:

Refused to apply style from 'http://localhost:8000/apps/Xterm/main.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

Checked the url, response was:

Cannot GET /apps/Xterm/main.css

checked the filesystem on the server, dist/apps/Xterm/ is empty. I’ve looked around, but couldn’t figure out how to solve the issue. Any idea is welcome.


Did you get any errors from the discovery command?


Also, how dis you install the fork you made?


Here is the output of discovery command:

[husnu@alarmpi OS.js]$ npm run package:discover

> @osjs/osjs@3.0.6 package:discover /home/husnu/apps/OS.js
> osjs-cli package:discover

ℹ Destination discovery map /home/husnu/apps/OS.js/packages.json                                                                                                                                                   package:discover 20:00:39
ℹ Destination path /home/husnu/apps/OS.js/dist                                                                                                                                                                     package:discover 20:00:40
ℹ Destination manifest /home/husnu/apps/OS.js/dist/metadata.json                                                                                                                                                   package:discover 20:00:40
ℹ Including /home/husnu/apps/OS.js/node_modules                                                                                                                                                                    package:discover 20:00:40
ℹ Including /home/husnu/apps/OS.js/src/packages                                                                                                                                                                    package:discover 20:00:40
ℹ Flushing out old discoveries                                                                                                                                                                                     package:discover 20:00:40
ℹ Discovering packages                                                                                                                                                                                             package:discover 20:00:40
[symlink] @osjs/calculator-application as Calculator                                                                                                                                                               package:discover 20:00:40
[symlink] @osjs/draw-application as Draw                                                                                                                                                                           package:discover 20:00:40
[symlink] @osjs/filemanager-application as FileManager                                                                                                                                                             package:discover 20:00:40
[symlink] @osjs/freedesktop-sounds as FreedesktopSounds                                                                                                                                                            package:discover 20:00:40
[symlink] @osjs/gnome-icons as GnomeIcons                                                                                                                                                                          package:discover 20:00:40
[symlink] @osjs/htmlviewer-application as HTMLViewer                                                                                                                                                               package:discover 20:00:40
[symlink] @osjs/musicplayer-application as MusicPlayer                                                                                                                                                             package:discover 20:00:40
[symlink] @osjs/preview-application as Preview                                                                                                                                                                     package:discover 20:00:40
[symlink] @osjs/settings-application as Settings                                                                                                                                                                   package:discover 20:00:40
[symlink] @osjs/standard-theme as StandardTheme                                                                                                                                                                    package:discover 20:00:40
[symlink] @osjs/textpad-application as Textpad                                                                                                                                                                     package:discover 20:00:40
[symlink] @osjs/xterm-application as Xterm                                                                                                                                                                         package:discover 20:00:40
✔ 12 package(s) discovered.                                                                                                                                                                                        package:discover 20:00:40
✔ Finished in 27646ms                                                                                                                                                                                                               20:00:40

I’ve installed it with the following command:

npm install --save --production git+https://github.com/husnusener/osjs-xterm-application.git


Aha! The reason you’re experiencing these issues is because the “npm” package you’re installing is the source, not a built distributable OS.js package. The official packages on npm usually just contain the dist/ directory.

So in order for this to work you’ll have to commit the dist/ directory into your repository (after you run NODE_ENV=production npm run build).

If you look at the dist/apps/Xterm link, you’ll probably find that this is missing, but the metadata.json was found during discovery, leading to it being “visible”, but not actually able to run.


Oh, I didn’t know that. Thanks.

I’ve started npm install command to fetch dependencies before the built, but it takes a lot time on my old pi, compilations are still ongoing. I’ll let you know the result when it’s finished. Thanks a lot!


Yes, it worked like a charm. Thank you for your quick support, and all effort to make the OS.js!


Awesome. Glad to hear you made it work :slight_smile: