Hari
Hari

Reputation: 51

npm install not working in windows 7 without giving any error

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!!

Upvotes: 5

Views: 6224

Answers (2)

Tirupati Rao
Tirupati Rao

Reputation: 615

enter image description here

check the proxy settings.
npm config get proxy

If proxy is correct then you might had cancelled the installation in the middle.

If you had done so, delete the folder named "node_modules" in your current directory (installation folder)which will be created while installation.

and restart the install (type npm install )

Upvotes: 0

simon_acc
simon_acc

Reputation: 63

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

Upvotes: 1

Related Questions