node.js – Nodejs Filepath incorrect, fs module
I am watching an NodeJs course on udemy and i’m trying to learn from there, but there is an error when im trying to write and read files with fs module it is giving me back this error.
undefined:1
undefined
^
SyntaxError: “undefined” is not valid JSON
at JSON.parse ()
at ReadFileContext.callback (C:\Users\Shpresim\Desktop\complete-node-bootcamp-master\complete-node-bootcamp-master\1-node-farm\main.js:17:32)
at FSReqCallback.readFileAfterOpen [as oncomplete] (node:fs:299:13)
I’m trying to read data’s from an api here.
How can i fix this
Thanks in advance!
Read more here: Source link
