Memory fs error on windows ==> throw new MemoryFileSystemError(errors.code.ENOENT, _path)
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))
I believe I have the same problem. @mazeeblanke have you found a solution?
@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
@VijayKrish93 okay thanks i will try it
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)