Thank you for your answer. It ended up helping me figure out what was wrong. I had made two mistakes. I was unaware that of the fact that I had made a duplicate folder during the course, which I mistakenly was accessing instead of the folder with the files with the most recently written program. This file I was accessing had the console.log(module); -line.
The second mistake, which was the reason I had to track back to implement older code that I had previously been able to execute, was that I hadn’t given my user the permission to use the downloads folder through terminal (I expect this is due to the newest MacOs update). I didn’t upload the errors logged by this mistake.