Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm install not working in windows 7 without giving any error

Tags:

node.js

npm

I am new to node and have installed latest version of nodejs on windows 7 from windows installer for node. For me node install is not working without giving any error. After giving command

npm install -g express

Cursors just waits and waits without showing any error message node(v 0.12.2) and npm(v2.7.4)
Any help is highly appreciated. Thanks!!

like image 430
Hari Avatar asked Nov 09 '22 15:11

Hari


1 Answers

had the same problem once, in case you installed some node packages before and there is already an node_modules folder try to delete it manually and rerun the npm install command.

alternatively try to create a package.json file like this:

package.json

{
  "name": "module-name",
  "version": "1.0.0",
  "description": "",
  "author": "Your Name",
  "dependencies": {
    "express": "4.2.x"
  },
  "license": ""
}

and run npm install in that folder

EDIT: just mentioned you try to install express globally, this is not needed, express is installed via npm install express --save (--save creates a dependency in the package.json file).

npm install express --save

express-generator

Another option would be to install the express-generator ,this one is installed globally ;)

npm install express-generator -g

and generate your initial project this way

like image 186
simon_acc Avatar answered Nov 15 '22 05:11

simon_acc