If you are using the Adafruit hat, your constructor is as follows:
let motor = new five.Motor(five.Motor.SHIELD_CONFIGS.ADAFRUIT_V2.M1)
And if you're using the L293D hat, your constructor is as follows:
let motor = new five.Motor(five.Motor.SHIELD_CONFIGS.ADAFRUIT_V1.M1)
Place whichever one applies inside the board.on('ready') function.