I try to use findNearest like that:
var sources = creep.room.findNearest(Game.SOURCES)
creep.moveTo(sources[0]);
creep.harvest(sources[0]);
and this is what i get:
TypeError: undefined is not a function
at module.exports:5:28
at <main>:11:6
How to use this method and findInRange so that they don't cause this error?