Fix syntax errors and npm install errors in index.js