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 6959851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:19:36+00:00 2026-05-27T15:19:36+00:00

If I need to require an npm module that is already installed as a

  • 0

If I need to require an npm module that is already installed as a sub dependency to another module, should I still install it with npm?

For instance, kue requires redis so red is is installed with kue e.g.
npm install kue

/node_modules/kue/node_modules/redis

should I still install redis as well, thus npm install redis

/node_modules/redis/

or is there a way I can add a reference to the redis installed from kue in my require statements

require("/node_modules/kue/node_modules/redis")

instead of

require ("redis")

or is there a better way?

  • 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-27T15:19:37+00:00Added an answer on May 27, 2026 at 3:19 pm

    Here’s a general rule of thumb:

    If you require('module-name') in your application’s source code, you should list module-name as a dependency. Treat dependencies of dependencies as opaque implementation details, and don’t concern yourself with them.

    This allows kue to depend on a different redis module version than your application, or switch out its implementation for a different module entirely. All without affecting your application.

    Node’s module system is different than “conventional” one (e.g. Ruby), in that multiple versions of the same module can be loaded in the same process without causing a conflict. This feels a bit off at first, but just go with it and you’ll see benefits quickly. I suspect that as the community explores this aspect of Node further, we’ll see some interesting projects arise to take advantage of it.

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

Sidebar

Related Questions

I have a console application that require to use some code that need administrator
I have a situation where I need to unit test some scenarios that require
I've been told that doing: config.gem 'tzinfo' doesn't obviate the need to require 'tzinfo'
I need to do a: require 'generator' Inside of a rails project, but it
For security, requests to a PHP webservice will require a Date: header. I need
I need to jump into the Spring Web Service Project, in that I required
I'm required to write a JCE provider. I have learned that I need to
Need a function that takes a character as a parameter and returns true if
I need to be able to conditionally require certain fields to be validated, based
all, i need to do this as the following require 'sinatra' require 'app_env' get

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.