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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:54:53+00:00 2026-05-24T13:54:53+00:00

The obvious way to promote a bundled dependency to a global module is by

  • 0

The obvious way to promote a bundled dependency to a global module is by moving the directory from node_modules/foo/node_modules/baz to node_modules/baz but is that all I have to do? Is there a secret handshake, without which things will mysteriously go wrong?

(While I’m asking yes/no questions: I notice that npm drops the node_module under whatever directory I happen to be in at the moment. Is this intended behavior — I can see how it would be useful for recursive installation of dependencies — or did I, with no sense of irony, mess up the installation of npm?)

(And speaking of yes/no questions about messed-up installations, my install of node does not automatically look in its own node_modules directory, I had to add it to NODE_PATH. Is this expected behavior?)

My appraisal after two days of node.js: great product, I don’t see why it isn’t even more popular than it is — I’m most the way through solving a problem that is absolutely unsolvable in the standard Apache/Tomcat systems I’m used to — but it’s harder to find answers to really simply question, like the above, than the big-picture ones (“how do I connect to MySQL?” “how do I load-balance?”)

  • 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-24T13:54:54+00:00Added an answer on May 24, 2026 at 1:54 pm

    npm as of version 1.0 changed how it did it’s installations in terms of Global vs Local.

    The short answer is if you want to install a module globally you can use the -g flag.

    npm install awesome-module -g

    If you want it locally you drop the -g flag.

    If you want your module to only be installed globally you can add

    "preferGlobal": true
    

    to your package.json

    As far as your second question goes, yes it is the intended behavior to drop node_module in whatever directory you’re in, that’s part of the local installation.

    Link to npm 1.0 release blog: http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation/

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

Sidebar

Related Questions

This will probably be obvious but I can't find the best way. I want
i am interested on this problem Interleave bits the obvious way (from http://graphics.stanford.edu/~seander/bithacks.html )
There's probably an obvious way to do this that I'm missing, so sorry for
Is there a way to set up a global variable inside of a module?
Is there an obvious way to do this that I'm missing? I'm just trying
I find it curious that the most obvious way to create Date objects in
Maybe I'm just pretty tired, but I don't see an obvious way to parse
Is there an obvious way to make a text input box that has rounded
Perhaps the most obvious way of protecting a company's intellectual property from its own
I combed through the Facebook documentation but didn't see an obvious way to return

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.