0

i am beginner for Node.js , i try to install some packages like express.js, underscore.js using Node.js by NPM but every time im trying to install using following command:

npm install express,

npm install underscore

Its showing error. please Refer following image,. please help me to fix this. how to install packages in npm by node.js

enter image description here

Thanks in Advance...

Jagdish Idhate
  • 7,513
  • 9
  • 35
  • 51
  • command line shows wrong command `npm view express` – Jagdish Idhate May 08 '17 at 07:58
  • Did you check your network settings as recommended by the error message? – TommyF May 08 '17 at 07:59
  • Network setting?? –  May 08 '17 at 08:02
  • can you ping the registry server? ```ping registry.npmjs.org``` – Josh May 08 '17 at 08:03
  • Its showing following C:\Workings\NodeJs_Projects\Training>ping registry.npmjs.org Pinging a.sni.fastly.net [151.101.112.162] with 32 bytes of data: Reply from 53.89.198.3: Destination host unreachable. Reply from 53.89.198.3: Destination host unreachable. Reply from 53.89.198.3: Destination host unreachable. Reply from 53.89.198.3: Destination host unreachable. Ping statistics for 151.101.112.162: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), –  May 08 '17 at 08:06
  • Hmm, I see a lot of "Destination host unreachable." Are you using a proxy or a firewall that might be blocking access? – Josh May 08 '17 at 08:09
  • Try ```npm config ls -l``` and let me know what the line says for proxy – Josh May 08 '17 at 08:15
  • its showing some long details., –  May 08 '17 at 08:26
  • You should see a line that says ```proxy = ``` What is the value? – Josh May 08 '17 at 08:28
  • it showing "proxy = null" –  May 08 '17 at 09:01
  • now what can i do for fixing it? –  May 09 '17 at 02:44

2 Answers2

0

You type npm view insted of npm install. Also you can add --save option

npm install underscore --save

What is the --save option for npm install?

Stanislav Mayorov
  • 4,298
  • 5
  • 21
  • 44
-1

as some other say, u looks having problem with network.. i've never try "npm view express" but in my case it give a list of all the repository and file .. are u sure u have installed node?

node -v

if u have something like v6.9.4 (this is my current version.. yours can be more recent)

try to create "package.json" using: npm init -y

and then: npm i --save express