user3698126
user3698126

Reputation: 89

How to specify module path in node.js

I am very new in Node.js, I installed angularjs and expressjs with bower, and I have app structure as below:

--parking
    --server.js
    --bower_components
        --angular
        --express
            --lib
               --express.js

In server.js, I want to import express module, How can I specify express module path in server.js, Could you give me some suggestions?

Upvotes: 1

Views: 129

Answers (1)

michelem
michelem

Reputation: 14590

Express is a Node.js module and it should be installed with npm instead bower:

$ npm install express --save

Then you simple require it in your server.js:

var express = require(express);

As per reference: Installing Express and Basic example

Upvotes: 1

Related Questions