dylang / node-rss

RSS feed generator for Node.
https://npmjs.org/package/rss
MIT License
999 stars 133 forks source link

Error: ENOENT: no such file or directory, stat 'path-to-file' #77

Open yarandoo opened 6 years ago

yarandoo commented 6 years ago

Hi,

I am getting this error, running the sample from the readme:

fs.js:940 binding.stat(pathModule._makeLong(path)); ^

Error: ENOENT: no such file or directory, stat 'path-to-file' at Object.fs.statSync (fs.js:940:11) at getSize (/Users/esteban/Desktop/feed/node_modules/rss/lib/index.js:28:15) at /Users/esteban/Desktop/feed/node_modules/rss/lib/index.js:89:61 at Array.forEach (native) at generateXML (/Users/esteban/Desktop/feed/node_modules/rss/lib/index.js:63:16) at RSS.xml (/Users/esteban/Desktop/feed/node_modules/rss/lib/index.js:185:17) at Object. (/Users/esteban/Desktop/feed/rss.js:72:16) at Module._compile (module.js:569:30) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:503:32)

Node Version 8.0.0, "rss": "^1.2.2", OpSystem: Sierra OS.

Error line: var xml = feed.xml();

Any ideas?

Thanks,

Esteban

amallecourt commented 6 years ago

It's because of the line : enclosure: {url:'...', file:'path-to-file'}, // optional enclosure You should remove the parameter "file" to get it work (or write path to an existing file I presume).