0

I recently study node and try to use npm to install node-inspector globally. But it always suspends here as following pic

problem pic

I have changed the registry config for times, but it still doesn't work. Anyone can help? TAT

YoungHobbit
  • 13,254
  • 9
  • 50
  • 73
OliverLee
  • 33
  • 4
  • Type this command first `npm config set loglevel verbose` and then run `npm install -g node-inspector` and see where the installation hangs. If you are using git, [try this](http://stackoverflow.com/questions/14937405/npm-git-protocol-dependencies): `git config --global url.https://github.com/.insteadOf git://github.com/` and then run install again. – zedfoxus Dec 09 '16 at 04:11
  • 1
    Thank you so much, I don't use git,so I tried the first way. It did post some errs which I can not understand clearly. Then I changed the registry to cnpm, it worked.....just worked...... – OliverLee Dec 09 '16 at 04:52
  • Excellent. You might want to add an answer yourself and mark your own answer as accepted to bring closure to your question. Besides, other people can find this question and your solution as an answer. – zedfoxus Dec 09 '16 at 05:01
  • How to mark it? I can mark your answer actually, because other people could see both answers. But I didn't find any button as "accepted"......Is the reason that yours is just a comment? – OliverLee Dec 09 '16 at 05:35
  • Okay, I can put my answer instead of comment. You can type your answer also. After 10-15 minutes of your posting your answer (not comment), you should see a check mark besides your answer. Click it so it turns green. That means you have accepted your own answer. – zedfoxus Dec 09 '16 at 14:36

1 Answers1

0

When npm install is stuck, you can increase verbosity of the output from install.

npm config set loglevel verbose
npm install -g node-inspector

Setting the log level to verbose will output a LOT of information. Based on the output you can find out where the errors/warnings are occurring and resolve them.

If git protocol is somehow involved and git's port is being blocked (TCP 9418), you could use https by doing

git config --global url.https://github.com/.insteadOf git://github.com/
npm install -g node-inspector

As you mentioned, you could use cnpm. Feel free to write your own answer and accept that one since that solved your problem.

Community
  • 1
  • 1
zedfoxus
  • 35,121
  • 5
  • 64
  • 63