Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

Memory fs error on windows ==> throw new MemoryFileSystemError(errors.code.ENOENT, _path) #60

Open
mazeeblanke opened this issue Apr 22, 2018 · 4 comments

Comments

@mazeeblanke
Copy link

mazeeblanke commented Apr 22, 2018

I'm trying to use this package on windows but i keep getting error : throw new MemoryFileSystemError(errors.code.ENOENT, _path)

In orer to debug the issue, i tried this and am still getting the same error

var MemoryFileSystem = require("memory-fs")
var fs = new MemoryFileSystem()

console.log(__dirname)

console.log(fs.readdirSync(__dirname))
@ilyaagarkov
Copy link

I believe I have the same problem. @mazeeblanke have you found a solution?

@Viijay-Kr
Copy link

@mazeeblanke Apparently its not an issue with the platform.__dirname points to your local working directory. In ur code ur trying to read it and it throws the error because its not yet created.

try

var MemoryFileSystem = require("memory-fs")
var fs = new MemoryFileSystem()
fs.mkdirpSync(__dirname)
console.log(__dirname)

console.log(fs.data)

The above piece will not throw an error as it creates a directory before its read

@mazeeblanke
Copy link
Author

@VijayKrish93 okay thanks i will try it

@CyanChoi
Copy link

still not work ... should I update the webpack? my webpack is ^2.7.0

/kuyu/html/activeCMS/dist/admin.html
[0]
[0] /kuyu/html/activeCMS/node_modules/memory-fs/lib/MemoryFileSystem.js:107
[0] throw new MemoryFileSystemError(errors.code.ENOENT, _path);
[0] ^
[0] Error: no such file or directory
[0] at MemoryFileSystem.readFileSync (/kuyu/html/activeCMS/node_modules/memory-fs/lib/MemoryFileSystem.js:107:10)
[0] at Compiler.clientCompiler.plugin (/kuyu/html/activeCMS/build/setup-dev-server.js:33:26)
[0] at Compiler.applyPlugins (/kuyu/html/activeCMS/node_modules/tapable/lib/Tapable.js:61:14)
[0] at Watching._done (/kuyu/html/activeCMS/node_modules/webpack/lib/Compiler.js:98:16)
[0] at onCompiled (/kuyu/html/activeCMS/node_modules/webpack/lib/Compiler.js:49:17)

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

No branches or pull requests

4 participants