How to fix RangeError: Index out of range (negative or too large offset) in Node.js | DevErrors