Fix path.resolve errors in newer node versions