Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3347100
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:22:54+00:00 2026-05-18T01:22:54+00:00

I have a directory structure like so: project lib paperboy redis-client node-cookie srv main.js

  • 0

I have a directory structure like so:

project
  lib
    paperboy
    redis-client
    node-cookie
  srv
    main.js
  ...

I start main.js from the project directory:

$ node srv/main.js

In main.js, I can do:

  paperboy = require('./lib/paperboy');

However, this fails:

  redis = require('./lib/redis-client');

Similarly, if I start interactive node in the “project” directory, I can require paperboy, but not redis-client. The error I get is:

> require('./lib/redis-client')
Error: Cannot find module './lib/redis-client'
    at resolveModuleFilename (node.js:265:13)
    at loadModule (node.js:231:20)
    at require (node.js:291:14)
...

Looking at the source for resolveModuleFilename(), it attempts to print a debug string, that I don’t see:

debug("looking for " + JSON.stringify(id) + " in " + JSON.stringify(paths));

I have tried enabling this through export NODE_DEBUG=1, but I still don’t see this debug print when trying to require.

What am I doing wrong in trying to get this debug to print?
And, second, why would paperboy load fine, but redis-client fail to be found?

Additional info: Here’s the full file/directory list in the “lib” directory:

lib
lib/cookie-node
lib/cookie-node/package.json
lib/cookie-node/LICENSE.txt
lib/cookie-node/README.markdown
lib/cookie-node/example
lib/cookie-node/example/ex1.js
lib/cookie-node/index.js
lib/redis-client
lib/redis-client/package.json
lib/redis-client/TODO.md
lib/redis-client/examples
lib/redis-client/examples/redis-version.js
lib/redis-client/examples/using-kiwi.js
lib/redis-client/examples/subscriber.js
lib/redis-client/examples/publisher.js
lib/redis-client/examples/.redis-version.js.swp
lib/redis-client/examples/README.md
lib/redis-client/seed.yml
lib/redis-client/LICENSE
lib/redis-client/test
lib/redis-client/test/test_throw_from_callback.js
lib/redis-client/test/test_shutdown_reconnect.js
lib/redis-client/test/test.js
lib/redis-client/test/sample.png
lib/redis-client/.gitignore
lib/redis-client/lib
lib/redis-client/lib/redis-client.js
lib/redis-client/README.md
lib/paperboy
lib/paperboy/package.json
lib/paperboy/seed.yml
lib/paperboy/LICENSE.txt
lib/paperboy/example
lib/paperboy/example/basic.js
lib/paperboy/example/webroot
lib/paperboy/example/webroot/img
lib/paperboy/example/webroot/img/paperboy.jpg
lib/paperboy/example/webroot/index.html
lib/paperboy/index.js
lib/paperboy/lib
lib/paperboy/lib/paperboy.js
lib/paperboy/README.md

The lib directories are unpacked .tar.gz files from github, re-named to match the module name from the package.json files.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T01:22:55+00:00Added an answer on May 18, 2026 at 1:22 am
    1. Node.js looks for requirable files relative to script location, so you should use

      paperboy = require(‘../lib/paperboy’);

      in srv/mail.js.

    2. You must configere node.js with –debug option and then make it to use any debug features, as I know.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have my directory structure like this: root/ sift/ __init__.py sift_descriptors.proto sift_descriptors_pb2.py project/ __init__.py
I have a directory structure like the following; script.php inc/include1.php inc/include2.php objects/object1.php objects/object2.php soap/soap.php
If i have the following directory structure: Project1/bin/debug Project2/xml/file.xml I am trying to refer
I have a large number of files in a ClearCase directory structure, and I
I am trying to determine the best directory structure of my application i have:
I have a directory of files that I'd like to append file extension to
I have a directory with 500,000 files in it. I would like to access
I have a directory structure in my SVN repository which is pretty standard: /project1
I have a directory with PDF files that I need to create an index
I have a directory with several subdirectories with files. How can I copy all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.