I am getting following error while using copySync method
Error: EISDIR: illegal operation on a directory, unlink '/path/to/dest'
at Object.fs.unlinkSync (fs.js:1081:18)
at copyFileSync (/path/to/project/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js:15:10)
at Object.copySync (/path/to/project/node_modules/fs-extra/lib/copy-sync/copy-sync.js:43:5)
at fs.ensureDir.err (/path/to/code.js:21:5)
at xfs.mkdir.er (/path/to/project/node_modules/fs-extra/lib/mkdirs/mkdirs.js:37:14)
at FSReqWrap.oncomplete (fs.js:114:15)
@akshaykumar12527 You're attempting to copy to a destination that already exists as a directory (/path/to/dest is a directory). That's why you're getting an error.
Most helpful comment
@akshaykumar12527 You're attempting to copy to a destination that already exists as a directory (
/path/to/destis a directory). That's why you're getting an error.