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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:44:10+00:00 2026-05-25T16:44:10+00:00

I recently installed node.js and was told that express was the way to go

  • 0

I recently installed node.js and was told that express was the way to go for routing and getting set up with web application development.

I installed the latest version of node which apparently is incompatible with the latest express.

I looked up and found nave… Like RVM, nave allows you to switch versions of node. So I ran nave.sh install 0.4.11... That worked successfully and I was able to run.

npm install express -g

This I thought, should install express globally. So I run:

express testapp

which creates

create : testapp
create : testapp/package.json
create : testapp/app.js
create : testapp/public/stylesheets
create : testapp/public/stylesheets/style.css
create : testapp/public/images
create : testapp/public/javascripts
create : testapp/views
create : testapp/views/layout.jade
create : testapp/views/index.jade

Then I

cd testapp/
node app.js

I get

Error: Cannot find module ‘express’

Is this usual behavior?

Since express is in packages.json, if I run npm install -d, it will create a node_modules directory in my application and not just symlink to the node_modules in my node path.

  • 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-25T16:44:11+00:00Added an answer on May 25, 2026 at 4:44 pm

    In a word, yes, this is the usual behavior.

    When you install packages using NPM with -g option, it installs it globally, which does nice things like putting executeables on your path (i.e. the express script you used)

    However, it does NOT put those packages anywhere that node can find them.

    To install it so node can find the package, you must also do

    cd "your express app"
    npm install express
    

    which installs locally (to the node_modules folder in the root of your application dir).

    This is primarily to avoid any dependencies conflicts, and though it may seem silly, it is in fact really useful.

    If you have some real reason to want to use your global install (say for example you have many applications that you want to make sure always share the same version) you can use the npm link command.

    For a good rundown of NPM and global vs local see this blog post.

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

Sidebar

Related Questions

I recently installed the 64 bit version of XP on my new development machine,
I recently installed the latest version of git (1.7.6) for OS X (10.7). When
Problem I recently updated to the latest version of node which is supposed to
I recently installed PHP on IIS/Windows 7, but it isn't working. I am getting
I recently installed jruby on a machine that also has ruby installed on it.
I recently installed Checkstyle plugin for Eclipse and personally think that it is awesome.
I recently installed/updated eclipse environment. When I try to compile the code I'm getting
I recently installed the RTM version of 4.0. I now receive an error when
I recently installed Visual Studio 2010 (Ultimate edition, final version released in April), and
I recently installed WAMP for actual local use. I've worked on live development servers

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.