简体   繁体   中英

how to run node.js client side code with browserify

我正在根据参考文档在客户端使用具有browserify的node.js ,并且我还使用http和browserify-fs js创建了一个包js,并且我在本地项目中都获得了两个对象,但是我对任何操作都使用了fs函数如读取文件,创建目录,appendfile等,它向我显示了相同的问题。

Error {errno: 34, code: "ENOENT", path: "/home/nikunjk/tmp", stack: (...), message: "ENOENT, no such file or directory '/home/nikunjk/tmp'"}

Reading from your second comment (and for those that would come looking for a feasible solution to perform file operations):

Use atom/electron to achieve this. You can easily access file system using fs node module and the electron app uses chromium V8 underneath.

Here is a link : http://electron.atom.io/

I have used it for some project and it works.

One caution: Dont mix node buffer and html5 apis to read or send files. Use node fs, request and buffers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM