beingGeek
beingGeek

Reputation: 1

Errors while installing expressjs on windows machine

I'm following this tutorial to install express JS. http://expressjs.com/2x/guide.html but I'm getting an error while installing the dependencies. Below is my error. Can somebody help me what I'm missing here?

C:\Users\myname\nodejs>npm install -d
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm ERR! install Couldn't read dependencies
npm ERR! package.json ENOENT, open 'C:\Users\myname\nodejs\package.json'
npm ERR! package.json This is most likely not a problem with npm itself.
npm ERR! package.json npm can't find a package.json file in your current directo
ry.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Users\\myname\\nodejs\\\\node.exe" "C:\\Users\\sainath.
g\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-d"
npm ERR! cwd C:\Users\myname\nodejs
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! path C:\Users\myname\nodejs\package.json
npm ERR! code ENOPACKAGEJSON
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Users\myname\nodejs\npm-debug.log
npm ERR! not ok code 0

C:\Users\myname\nodejs>node app.js

module.js:340
    throw err;
          ^
Error: Cannot find module 'C:\Users\myname\nodejs\app.js'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3

Upvotes: 0

Views: 103

Answers (1)

Pantelis Ieronimakis
Pantelis Ieronimakis

Reputation: 141

You are a following a guide to express.js version 2.0 which is deprecated. The latest express.js version is 4 and this is the guide you should actually follow : express.js Getting Started Guide

Upvotes: 1

Related Questions