Getting an error when starting the main Express project

I first messed around with Node.js and decided to create a simple application using express. I followed the github instructions in an empty directory:

npm install -g express
express
npm install -d
node app.js

When switching to localhost:3000I get the following error:

Express
500 Error: Cannot find module './lib/jade'
at Function._resolveFilename (module.js:332:11)
at Function._load (module.js:279:25)
at Module.require (module.js:354:17)
at require (module.js:370:17)
at Object. (C:\dev\gravity_kata\node_modules\jade\index.js:4:5)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
at Module.load (module.js:348:31)
at Function._load (module.js:308:12)
at Module.require (module.js:354:17)

When you look under node_modules\jade\lib, I see all the files in the Jade library, but not jade. So I created a folder under lib called jade and moved the library files there, and now my default application is working.

Now, having seen that I have almost no experience with Node.js and Express, I am sure that I did something wrong. Does anyone know what is going on here?

Edit:

. Jade index.js lib\jade lib, jade.js. , , jade.js ? Jade npm, lib jade.js. lib Jade , .

- npm jade.js. packages.json , , 0.21.0. - , ?

+5
5

, , jade 0.22.0 .

+2

cd - "npm install",

+11

, , , (-g), npm install -d . , , , :

sudo npm uninstall express -g
npm install express
npm install jade (or npm install -d)
+2

, require . Javascript , . , .

0

. , jade (- ). . . npm uninstall gulp -jade, gulp -jade again

0

All Articles