Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS.statSync is not a function #73

Open
ivanvorona opened this issue Mar 3, 2020 · 3 comments
Open

FS.statSync is not a function #73

ivanvorona opened this issue Mar 3, 2020 · 3 comments

Comments

@ivanvorona
Copy link

ivanvorona commented Mar 3, 2020

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?

@mihneadb
Copy link
Owner

mihneadb commented Mar 3, 2020

Hi @ivanvorona - are you running this under node? What version?

@ivanvorona
Copy link
Author

ivanvorona commented Mar 3, 2020

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/cli-plugin-babel@3.12.1
| -- webpack@4.41.5 +-- @vue/cli-plugin-eslint@4.2.3 | -- webpack@4.41.5 deduped
-- @vue/cli-service@3.12.1 -- webpack@4.41.5 deduped

@mihneadb
Copy link
Owner

mihneadb commented Mar 5, 2020

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants