use path.join(__dirname, 'error.html')  will be better.