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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:15:38+00:00 2026-05-27T16:15:38+00:00

If I install Benchmark.js locally with npm install benchmark than everything works good: require(benchmark)

  • 0

If I install Benchmark.js locally with npm install benchmark than everything works good:

require("benchmark") > Object

But when I try to install Benchmark globally with -g flag npm install benchmark -g, Nodejs cannot find the module (remove first the locally installed benchmark):

require("benchmark") > Error: Cannot find module 'benchmark'

I tryed under Windows and Linux both. The same results. Locally work, globally not. Can anyone help me WHY?

The mongodb module works globally.

  • 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-27T16:15:38+00:00Added an answer on May 27, 2026 at 4:15 pm

    You can do it using npm link. For example – express – npm link express

    npm install -g express
    cd <your-application-development-path>
    npm link express
    

    A symbolic will be created linking express

    xxx@xxx:~/Programming/web/foo$ ls -lrt node_modules
    total 12
    drwxr-xr-x 2 xxxx xxxx 4096 2011-12-21 17:07 .bin/
    lrwxrwxrwx 1 xxxx xxxx   38 2011-12-21 17:07 express -> ../../../node/lib/node_modules/express/
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

gem install rubyoverflow irb > require 'rubyoverflow' => true But: require 'rubyoverflow' include Rubyoverflow
I had Ruby 1.9.2 install, but I uninstalled it long ago. Today I installed
I install and configure Active Admin to my rails app. It works fine on
I install the subversion on my windows server 2008. But it's only work localhost.
I'm trying to install acts_as_audited on rails 3, but the docs seem to only
Install Code ignitor 1.7.3 and try to convert my existing project which is in
I recently tried to install nodejs on Ubuntu Natty on my WMWare Workstation. I
When trying to install Bundler 0.8.1 on Ubuntu machine, it install fine but the
I tried to install SOAP::WSDL on Ubuntu 8.04 Server through CPAN but got the
I remember I used gem install rails to install Rails, but today when I

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.