FS.statSync is not a function
Hello,
i got this error: "FS.statSync is not a function at directoryTree (directory-tree.js?1168:57)"
upon debugging it comes from here:
function directoryTree (path, options, onEachFile, onEachDirectory) {
const name = PATH.basename(path);
path = options && options.normalizePath ? normalizePath(path) : path;
const item = { path, name };
let stats;
console.log(path);
**try { stats = FS.statSync(path); }**
catch (e) {
console.log(e);
return null; }
i guess it make sense to catch it and show? also, any idea why i am getting it?
Hi @ivanvorona - are you running this under node? What version?
Hi @mihneadb thank you for quick turnaround.
Yes - vueJS app, - tried on v10, installed the most recent stable v12 - the same result: ****>npm view webpack version 4.42.0
**>node -v v12.16.1
******>npm list webpack
@0.1.0 **
+-- @vue/[email protected]
| -- [email protected] +-- @vue/[email protected] | -- [email protected] deduped
-- @vue/[email protected] -- [email protected] deduped
@ivanvorona it looks like you are trying to run this in a browser or in a browser-like environment, where you don't have access to the FS module.