How does module_file looks like? There are some rules, for instance,
if its in the same folder it should start with ./, like
require('./somefile')
2012/12/26,
dar...@darrenwhitlen.com <
dar...@darrenwhitlen.com>:
> Hi,
>
> Trying to simply require() in a .js file seems to be failing for me here,
> raising a MODULE_NOT_FOUND error.
> However - a fs.readFileSync() on the file does work.
>
> My current failing debug code:
> // Fails
> require(require('path').resolve(module_file));
>
> // Works
> require('fs').readFileSync(require('path').resolve(module_file), 'UTF8');
>
> Since the readFileSync() call works I can rule out any file/directory
> permissions leaving me with absolutely no ideas left as to why require()
> cannot find the file?
>
> Anyone have any debugging pointers to share?
>
> Darren
>
> --
> Job Board:
http://jobs.nodejs.org/
> Posting guidelines:
>
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to
nod...@googlegroups.com
> To unsubscribe from this group, send email to
>
nodejs+un...@googlegroups.com
> For more options, visit this group at
>
http://groups.google.com/group/nodejs?hl=en?hl=en
>
--
Enviado desde mi dispositivo móvil