Monday, 24 April 2017

NodeJS throws Illegal instruction: 4 on Mac OS

Whenever I run my program it throws Illegal instruction: 4 and I have no idea why.

My code:

glob('/path/music/*.mp3', function(error, files) {
for(var i = 0; i < files.length; i++) {
    songs.push(files[i]);
    console.log("Added file: " + files[i]);
}

console.log("Init player");
p = new player(songs)
    .on('playing', function(song){
        console.log("Playing now: " + song._name);
    })
    .on('playend', function(song){
        console.log("Next song....");
    })
    .on('error', function(song){
        console.log("Error:" + error);
    }).play();

    setTimeout(function(){ p.stop();},5000);


    console.log(JSON.stringify(p))
});

So the program should play a mp3 file from my path for 5 seconds and stop it after that but after it plays for 5 seconds the program terminates and the console output is:

> node script.js
Playing now: music.mp3
Illegal instruction: 4

I'm using the player package from npm: https://www.npmjs.com/package/player



via Beyond

No comments:

Post a Comment