简体   繁体   English

如何从流星访问node.js的文件系统?

[英]How do I access node.js' filesystem from meteor?

I'm really new to meteor and node.js and I think it's really awesome! 我真的是流星和node.js的新手,我认为它真的很棒!

So the issue I am having is that I cannot access node's filesystem module from meteor. 所以我遇到的问题是我无法从流星访问节点的文件系统模块。 On stackoverflow, other users have reported that they use 在stackoverflow上,其他用户报告他们使用了

var require = __meteor_bootstrap__.require;
var fs = require('fs');

However, when I call it, I get this error: 但是,当我调用它时,出现此错误:

TypeError: undefined is not a function TypeError:未定义不是函数

I followed this this question's answer and I don't know what to do from here. 我遵循了这个问题的答案 ,我不知道该怎么办。 I have made sure that the code above is located in the startup portion of the server. 我已确保上面的代码位于服务器的启动部分。

从流星0.6.0开始,它将是:

var fs = Npm.require("fs");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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