Cycle detection in directed graph

Well why do we need to use stack and all we can do this simply by checking if the node has already visited and we are coming on it again then that path contains a cycle isn’t it ??