node-sass ionic nodejs error fix

Posted on Updated on

Sometimes you go on a bug fixing journey and get no-where. Like always, when I find a solution to a lengthy problem, I write it up so I can remember it later.

I had this error show up, after doing an update to the latest version of Ionic, and for over an hour and a half, I upgraded NPM packages and everything, changed and updated code and got no-where.

I then went back and reverted to my last commit, rerun this command: (as found here)

node node_modules/node-sass/scripts/install.js

Where it eventually started working again.

Happy, but rather frustrated that it has to happen.

stephenmonro@SMMMacPro:~/ionicApps/project$ ionic serve
> ionic-app-scripts serve --address localhost --port 8100 --livereload-port 35729 --dev-logger-port 53703 --nobrowser
[app-scripts] fs.js:114
[app-scripts] throw err;
[app-scripts] ^
[app-scripts] Error: ENOENT: no such file or directory, scandir '/Users/stephenmonro/ionicApps/project/node_modules/node-sass/vendor'
[app-scripts] at Object.readdirSync (fs.js:785:3)
[app-scripts] at Object.getInstalledBinaries (/Users/stephenmonro/ionicApps/project/node_modules/node-sass/lib/extensions.js:132:13)
[app-scripts] at foundBinariesList (/Users/stephenmonro/ionicApps/project/node_modules/node-sass/lib/errors.js:20:15)
[app-scripts] at foundBinaries (/Users/stephenmonro/ionicApps/project/node_modules/node-sass/lib/errors.js:15:5)
[app-scripts] at Object.module.exports.missingBinary (/Users/stephenmonro/ionicApps/project/node_modules/node-sass/lib/errors.js:45:5)
[app-scripts] at module.exports (/Users/stephenmonro/ionicApps/project/node_modules/node-sass/lib/binding.js:15:30)
[app-scripts] at Object.<anonymous> (/Users/stephenmonro/ionicApps/project/node_modules/node-sass/lib/index.js:14:35)
[app-scripts] at Module._compile (internal/modules/cjs/loader.js:701:30)
[app-scripts] at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
[app-scripts] at Module.load (internal/modules/cjs/loader.js:600:32)

[ERROR] ionic-app-scripts has unexpectedly closed (exit code 1).

The Ionic CLI will exit. Please check any output above for error details.
stephenmonro@SMMMacPro:~/ionicApps/project$ nodejs node_modules/node-sass/scripts/install.js
-bash: nodejs: command not found
stephenmonro@SMMMacPro:~/ionicApps/project$ node node_modules/node-sass/scripts/install.js
Downloading binary from
Download complete
Binary saved to /Users/stephenmonro/ionicApps/project/node_modules/node-sass/vendor/darwin-x64-64/binding.node
stephenmonro@SMMMacPro:~/ionicApps/project$ ionic serve
> ionic-app-scripts serve --address localhost --port 8100 --livereload-port 35729 --dev-logger-port 53703 --nobrowser
[app-scripts] [01:26:03] ionic-app-scripts 3.2.4


Also, another fun bug you could be chasing for a long this is to do with the .subscribe method.

“ERROR TypeError: Object(…) is not a function”.

For example, the following code: this.globals.apiserver + "post_user_track_location.php", trackstringdata, options)
.subscribe(data => { 
this.returned = data; 
//console.log (this.items); 
console.log (data); 

If you are running off a “localhost” change it to

It may just work for you.


DOSBOX Autoexec.bat

Posted on Updated on

This took me a while to locate on my computer, but I eventually found it, and I’ll share the location and what I’ve done.

The current official wiki is here, but it seems to not reflect my current situation.

The settings for me are located here:
/Users/stephenmonro/Library/Preferences/DOSBox 0.74 Preferences

This is a text file, and it can be opened and edited easily.

This is my current dosbox preferences file:


# This is the configurationfile for DOSBox 0.74. (Please use the latest version of DOSBox)
# Lines starting with a # are commentlines and are ignored by DOSBox.
# They are used to (briefly) document the effect of each option.

# fullscreen: Start dosbox directly in fullscreen. (Press ALT-Enter to go back)
# fulldouble: Use double buffering in fullscreen. It can reduce screen flickering, but it can also result in a slow DOSBox.
# fullresolution: What resolution to use for fullscreen: original or fixed size (e.g. 1024x768).
# Using your monitor's native resolution with aspect=true might give the best results.
# If you end up with small window on a large screen, try an output different from surface.
# windowresolution: Scale the window to this size IF the output device supports hardware scaling.
# (output=surface does not!)
# output: What video system to use for output.
# Possible values: surface, overlay, opengl, openglnb.
# autolock: Mouse will automatically lock, if you click on the screen. (Press CTRL-F10 to unlock)
# sensitivity: Mouse sensitivity.
# waitonerror: Wait before closing the console if dosbox has an error.
# priority: Priority levels for dosbox. Second entry behind the comma is for when dosbox is not focused/minimized.
# pause is only valid for the second entry.
# Possible values: lowest, lower, normal, higher, highest, pause.
# mapperfile: File used to load/save the key/event mappings from. Resetmapper only works with the defaul value.
# usescancodes: Avoid usage of symkeys, might not work on all operating systems.


# language: Select another language file.
# machine: The type of machine tries to emulate.
# Possible values: hercules, cga, tandy, pcjr, ega, vgaonly, svga_s3, svga_et3000, svga_et4000, svga_paradise, vesa_nolfb, vesa_oldvbe.
# captures: Directory where things like wave, midi, screenshot get captured.
# memsize: Amount of memory DOSBox has in megabytes.
# This value is best left at its default to avoid problems with some games,
# though few games might require a higher value.
# There is generally no speed advantage when raising this value.


# frameskip: How many frames DOSBox skips before drawing one.
# aspect: Do aspect correction, if your output method doesn't support scaling this can slow things down!.
# scaler: Scaler used to enlarge/enhance low resolution modes.
# If 'forced' is appended, then the scaler will be used even if the result might not be desired.
# Possible values: none, normal2x, normal3x, advmame2x, advmame3x, advinterp2x, advinterp3x, hq2x, hq3x, 2xsai, super2xsai, supereagle, tv2x, tv3x, rgb2x, rgb3x, scan2x, scan3x.


# core: CPU Core used in emulation. auto will switch to dynamic if available and appropriate.
# Possible values: auto, dynamic, normal, simple.
# cputype: CPU Type used in emulation. auto is the fastest choice.
# Possible values: auto, 386, 386_slow, 486_slow, pentium_slow, 386_prefetch.
# cycles: Amount of instructions DOSBox tries to emulate each millisecond.
# Setting this value too high results in sound dropouts and lags.
# Cycles can be set in 3 ways:
# 'auto' tries to guess what a game needs.
# It usually works, but can fail for certain games.
# 'fixed #number' will set a fixed amount of cycles. This is what you usually need if 'auto' fails.
# (Example: fixed 4000).
# 'max' will allocate as much cycles as your computer is able to handle.
# Possible values: auto, fixed, max.
# cycleup: Amount of cycles to decrease/increase with keycombo.(CTRL-F11/CTRL-F12)
# cycledown: Setting it lower than 100 will be a percentage.


# nosound: Enable silent mode, sound is still emulated though.
# rate: Mixer sample rate, setting any device's rate higher than this will probably lower their sound quality.
# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716.
# blocksize: Mixer block size, larger blocks might help sound stuttering but sound will also be more lagged.
# Possible values: 1024, 2048, 4096, 8192, 512, 256.
# prebuffer: How many milliseconds of data to keep on top of the blocksize.


# mpu401: Type of MPU-401 to emulate.
# Possible values: intelligent, uart, none.
# mididevice: Device that will receive the MIDI data from MPU-401.
# Possible values: default, win32, alsa, oss, coreaudio, coremidi, none.
# midiconfig: Special configuration options for the device driver. This is usually the id of the device you want to use.
# See the README/Manual for more details.


# sbtype: Type of Soundblaster to emulate. gb is Gameblaster.
# Possible values: sb1, sb2, sbpro1, sbpro2, sb16, gb, none.
# sbbase: The IO address of the soundblaster.
# Possible values: 220, 240, 260, 280, 2a0, 2c0, 2e0, 300.
# irq: The IRQ number of the soundblaster.
# Possible values: 7, 5, 3, 9, 10, 11, 12.
# dma: The DMA number of the soundblaster.
# Possible values: 1, 5, 0, 3, 6, 7.
# hdma: The High DMA number of the soundblaster.
# Possible values: 1, 5, 0, 3, 6, 7.
# sbmixer: Allow the soundblaster mixer to modify the DOSBox mixer.
# oplmode: Type of OPL emulation. On 'auto' the mode is determined by sblaster type. All OPL modes are Adlib-compatible, except for 'cms'.
# Possible values: auto, cms, opl2, dualopl2, opl3, none.
# oplemu: Provider for the OPL emulation. compat might provide better quality (see oplrate as well).
# Possible values: default, compat, fast.
# oplrate: Sample rate of OPL music emulation. Use 49716 for highest quality (set the mixer rate accordingly).
# Possible values: 44100, 49716, 48000, 32000, 22050, 16000, 11025, 8000.


# gus: Enable the Gravis Ultrasound emulation.
# gusrate: Sample rate of Ultrasound emulation.
# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716.
# gusbase: The IO base address of the Gravis Ultrasound.
# Possible values: 240, 220, 260, 280, 2a0, 2c0, 2e0, 300.
# gusirq: The IRQ number of the Gravis Ultrasound.
# Possible values: 5, 3, 7, 9, 10, 11, 12.
# gusdma: The DMA channel of the Gravis Ultrasound.
# Possible values: 3, 0, 1, 5, 6, 7.
# ultradir: Path to Ultrasound directory. In this directory
# there should be a MIDI directory that contains
# the patch files for GUS playback. Patch sets used
# with Timidity should work fine.


# pcspeaker: Enable PC-Speaker emulation.
# pcrate: Sample rate of the PC-Speaker sound generation.
# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716.
# tandy: Enable Tandy Sound System emulation. For 'auto', emulation is present only if machine is set to 'tandy'.
# Possible values: auto, on, off.
# tandyrate: Sample rate of the Tandy 3-Voice generation.
# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716.
# disney: Enable Disney Sound Source emulation. (Covox Voice Master and Speech Thing compatible).


# joysticktype: Type of joystick to emulate: auto (default), none,
# 2axis (supports two joysticks),
# 4axis (supports one joystick, first joystick used),
# 4axis_2 (supports one joystick, second joystick used),
# fcs (Thrustmaster), ch (CH Flightstick).
# none disables joystick emulation.
# auto chooses emulation depending on real joystick(s).
# (Remember to reset dosbox's mapperfile if you saved it earlier)
# Possible values: auto, 2axis, 4axis, 4axis_2, fcs, ch, none.
# timed: enable timed intervals for axis. Experiment with this option, if your joystick drifts (away).
# autofire: continuously fires as long as you keep the button pressed.
# swap34: swap the 3rd and the 4th axis. can be useful for certain joysticks.
# buttonwrap: enable button wrapping at the number of emulated buttons.


# serial1: set type of device connected to com port.
# Can be disabled, dummy, modem, nullmodem, directserial.
# Additional parameters must be in the same line in the form of
# parameter:value. Parameter for all types is irq (optional).
# for directserial: realport (required), rxdelay (optional).
# (realport:COM1 realport:ttyS0).
# for modem: listenport (optional).
# for nullmodem: server, rxdelay, txdelay, telnet, usedtr,
# transparent, port, inhsocket (all optional).
# Example: serial1=modem listenport:5000
# Possible values: dummy, disabled, modem, nullmodem, directserial.
# serial2: see serial1
# Possible values: dummy, disabled, modem, nullmodem, directserial.
# serial3: see serial1
# Possible values: dummy, disabled, modem, nullmodem, directserial.
# serial4: see serial1
# Possible values: dummy, disabled, modem, nullmodem, directserial.


# xms: Enable XMS support.
# ems: Enable EMS support.
# umb: Enable UMB support.
# keyboardlayout: Language code of the keyboard layout (or none).


# ipx: Enable ipx over UDP/IP emulation.


# Lines in this section will be run at startup.
# You can put your MOUNT lines here.


While everything is pretty much standard, the thing you’ll be most interested in is at the bottom under the [autoexec] entry.

I have a path called DOSGAMES in my \Users\StephenMonro\ directory. This becomes my C drive when DOSBox launches.

In there, I make sure I start out and make sure I’m actually in the C drive, and then I call a batch file.

This is the contents of the batch file:

echo off
: Point & Shoot Startup File 
: Place this file in a directory in your PATH statement.
: To access Point & Shoot, type MENU
cd \MENU


That batch file opens the classic “Point and Shoot Menu”, which was, in my opinion one of the easiest and best DOS menu system. I don’t know where we got it from originally, but it worked great. It’s also a little bit of a rarity on the internet too.

I have uploaded the program here which you can download.

Point and Shoot Menu download:

Screen Shot 2019-12-12 at 12.18.05

Screen Shot 2019-12-12 at 13.22.31Screen Shot 2019-12-12 at 13.21.43Screen Shot 2019-12-12 at 13.21.00Screen Shot 2019-12-12 at 13.20.40Screen Shot 2019-12-12 at 13.20.51

Enjoy using DOSBox. 🙂





Ionic Build Scripts

Posted on

I don’t like repetitive manual work, especially if can automate or script it.

In honour of that, these are my Ionic build scripts.

ionic cordova platform rm android
ionic cordova platform add android@6.4.0
ionic cordova build android --prod --release --debug

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.jks platforms/android/build/outputs/apk/release/android-release-unsigned.apk my-alias

cp ~/Library/Android/sdk/build-tools/27.0.3/zipalign platforms/android/build/outputs/apk/release/

cd platforms/android/build/outputs/apk/release/
rm app_name.apk
./zipalign -v 4 android-release-unsigned.apk app_name.apk

# copy to MEGA
cp app_name.apk /Volumes/Creative2HD/MEGASync/C4I/app_name_1.apk

cd ..
cd ..
cd ..
cd ..
cd ..
cd ..
cd ..
ionic cordova platform remove ios
ionic cordova platform add ios

cd platforms
cd ios
pod install
cd ..
cd ..

ionic cordova build ios --prod --release --buildFlag="-UseModernBuildSystem=0"

cd platforms
cd ios

pod install
pod repo update

open "APP_NAME.xcworkspace"

cd ..
cd ..
ionic cordova platform remove android
ionic cordova platform add android@6.4.0 
ionic cordova build android
ionic cordova run android --no-native-run
ionic cordova run android --device


Directory listing

Posted on

A part of me feels that the art of command-line usage is leaving us.

If you’ve ever wanted to get a list of files from in a directory and stored in a text file, it’s really simple.

Just do this.

If you are on Windows, open the run box (Windows+R) and type cmd, then enter.

Navigate to the directory you want, or for this example, you’ll get a list of all the files in your home directory (or folder).

Type this: C:\Users\smonro>dir /r/s/b > files.txt

You will then get a long list of everything in the file named “files.txt”.



Running Catalina on a MacPro 4,1->5,1

Posted on Updated on

I’ll start by saying that I tried, succeeded, and then reverted to High Sierra.

This is not a how to guide, as there are plenty of sites dedicated to that, but this is my journey.

It started my journey with a new 2TB SSD which I cloned my current OS to. It rebooted fine, and everything was great.

I then proceeded to the latest and greatest of Catalina.

Following the instructions from dosdude, it eventually worked. But I ran in to a few minor hiccups.

The computer wouldn’t boot properly with my graphics card of gtx 770.

Once that came out it went to the login screen.

After that it went a little interesting.
Not everything worked.

There are the obvious 32 bit programs that won’t run, but is more than that.
My presonus studio192 wasn’t found, a show stopper, and I got a billion notifications to authorise things.
Filr crashed.

Dark and light mode are still screwy too.
There are no NVidia drivers available or compatible.

In the end I conclude that it’s just not worth the upgrade.

The gains do not outweigh the losses.

Instead of installing catalina and using vms for 32bit programs, I’ll go the other way and use catalina in a vm, and see how that goes, now that I have a 2TB ssd. 😊

As a side note, my GTX770 card has still been working these years without problems, it’s just lack of driver support that will continue now with future versions of the OS X.

Other than that, it all works well. Oh, and computer has had its cpu tray updated since the gfx card upgrade.

But, this is really just a good excuse to vacuum the insides.

Secret menu in an Ionic App

Posted on Updated on

I wanted a way for people to be able to reset the app, kind of for debugging purposes and while a “reset button” works, I don’t think it’s best to have it public.

So, after looking around, I thought that maybe a hold for 5 seconds with a counter would work. However, I came across a post asking a similar, but not the same idea and it triggered my mind to try something different.

Basically, you tap and hold 5 times on the ‘Header Text’ and then, your secret function will trigger.

Here’s my example:

Please note, WordPress source-code formatting is terrible.


<ion-title (press)="pressEvent($event)">About App {{press_text}}</ion-title>

<ion-content padding>
<h1>App Name</h1>
<p>Version: 1</p>
<p>Created with love by me </p>



import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams, ModalController } from 'ionic-angular';
import { Storage } from '@ionic/Storage';
import { StartPopupPage } from '../start-popup/start-popup';

* Generated class for the AboutPage page.

 selector: 'page-about',
 templateUrl: 'about.html',

export class AboutPage 
  publicnavCtrl: NavController,
  privatestorage: Storage,
  privatemodal: ModalController,
  publicnavParams: NavParams) 

 publicpress: number = 0;
 publicpress_text: string = "";
  this.press_text = + "";
  if ( >= 5)
   // Do something after the header has been pressed 5 times.
   // In this case, it runs the function and the resets everything
   // back to 0 ready to reset the function again if required.
   this.resetSettings(); = 0;
   this.press_text = "";

  console.log('ionViewDidLoad AboutPage');

// Doing something after the header has been pressed 5 times.
 async resetSettings()
  // clear out the data'Settings1', null);'Settings2', null);
  // Show a modal.
  // You'll need a popup html page too 
  constprofileModal = this.modal.create(StartPopupPage);
  profileModal.onDidDismiss(data => 

jVectormap the basics

Posted on Updated on

I needed to make a map with some text labels, and it was not an easy feat, as the documentation (while there) is not very clear, and the examples floating around the internet are sketchy at best as well.

Here’s my little map of Australia.

The labels are permanent, and ready to have the JS changed, to display counts, or values if required.

It’s not entirely finished, but it works.

This needs the Australia map downloaded in the same path as this code.
Here is my gist:


<!DOCTYPE html>
<html lang="en">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Country Map Example</title> 

<link rel="stylesheet" href="" type="text/css">
.jvectormap-region.jvectormap-element {
text-shadow: -1px -1px 3px #fff, 1px -1px 3px #fff, -1px 1px 3px #fff, 1px 1px 3px #fff;
div id="map1" style="width: 800px; height: 600px"> 

var locations = [
{ latLng: [-35.27603, 149.13435], name: "ACT", text: "This is a text of one.", style: {r: 0}},
{ latLng: [-32, 147], name: "NSW", text: "This is a text of one.", style: {r: 0} },
{ latLng: [-22, 144.25], name: "QLD", text: "This is a text of one.", style: {r: 0} },
{ latLng: [-41.5, 146.030], name: "TAS", text: "This is a text of one.", style: {r: 0} },
{ latLng: [ -36.760, 144.280], name: "VIC", text: "This is a text of one.", style: {r: 0} },
{ latLng: [-26.230, 120.380], name: "WA", text: "This is a text of one.", style: {r: 0} },
{ latLng: [-22.000, 133.380], name: "NT", text: "This is a text of one.", style: {r: 0} },
{ latLng: [-29.000, 135.380], name: "SA", text: "This is a text of one.", style: {r: 0} }, 


$(document).ready(function () {
var map = "au_mill";
map: 'au_mill', // map
zoomOnScroll: false, 
zoomButtons : false,
regionStyle: { // color of the map
initial: {
fill: '#B8E186' // standard colour
selected: {
fill: '#F4A582' // on hover
backgroundColor: '#383f47', // page color 
markers: locations, // the values
markerLabelStyle: { // the value formatting
initial: {
'font-family': 'Verdana',
'font-size': '40px',
'font-weight': 'bold',
cursor: 'default',
fill: 'red'
hover: {
cursor: 'pointer'

labels: { // this paints the labels on the map
markers: {
render: function(index){
return locations[index].name;
offsets: function(index){
var offset = locations[index]['offsets'] || [0, 0];
return [offset[0] - 7, offset[1] + 3];