Q:

In Node.js, I am getting an error saying that I have an unexpected identifier for setTimeout(). What's going on?

As a beginner in programming, I am doing a fun project with a raspberry pi. I am writing a simple program for a raspberry pi with a node module, and I would like to delay the GPIO pins of my pi to turn on and off (for now). I'm using set Timeout() to delay my turning off the GPIO pin.
The big problem is that when I run my file, I get an error saying that setTimeout() is an unexpected identifier. Some help?
More information on the node module that I used can be found in this link: https://www.npmjs.com/package/pi-gpio
My code:
var gpio = require("pi-gpio");
var timers = require("timers"); //thought this might help fix problem
function start(){
    gpio.open(7, "output", function(err) {     // Open pin 7 for output 
    gpio.write(7, 1, function() {          // Set pin 7 high (1) 
        gpio.close(7);                     // Close pin 7 
    });
  });
}
function stop(){
    gpio.open(7, "output", function(err) {     // Open pin 7 for output 
    gpio.write(7, 0, function() {          // Set pin 7 low(0) 
       gpio.close(7);                     // Close pin 7 
   });
}
setTimeout(start,1000);
setTimeout(stop,3000);

This is the error I got on the SSH terminal:
pi@raspberrypi ~ $ node armrobot.js
/home/pi/armrobot.js:16
setTimeout(start,1000);
^^^^^^^^^^
SyntaxError: Unexpected identifier
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

A:

You didn't close the stop function correctly.
function stop(){
    gpio.open(7, "output", function(err) {     // Open pin 7 for output 
        gpio.write(7, 0, function() {          // Set pin 7 low(0) 
            gpio.close(7);                     // Close pin 7 
        });
    });
}

