0

I was trying to fix SSL issue in npm by following this link receiving error: 'Error: SSL Error: SELF_SIGNED_CERT_IN_CHAIN' while using npm

by running this command

sudo npm install npm -g --ca=""

after that, my npm stopped working and returning below error

-bash: /usr/local/bin/npm: No such file or directory

Kindly advice...

Community
  • 1
  • 1
iwan
  • 7,269
  • 18
  • 48
  • 66

1 Answers1

0

It sounds like your "-g" corrupted your npm install.

SUGGESTION: re-install npm.

1) try npm cache clean

If that doesn't work, try:

2) Remove everything from ~/.npm

3) Re-install npm

FoggyDay
  • 11,962
  • 4
  • 34
  • 48
  • thank you FoggyDay, the first step is failed because "npm" is not recognized... wondering if I could avoid re-install npm? – iwan Apr 19 '14 at 23:55
  • Q: Did you try "npm cache clean"? Or did you just assume it wouldn't work? Q: Did you "ls -l /usr/local/bin/npm". It's entirely possible the "No such file or directory" error might be coming from a corrupt/incorrect script. Q: Why can't you re-install npm? If it's your own PC, it's quick and trivial. If it's somebody else's server (e.g. your school's), then you should contact the system administrator. IMHO... – FoggyDay Apr 20 '14 at 01:07
  • thanks a lot, i followed your suggestion to reinstall it. Experienced few bumps then finally this re-install command working "sudo curl http://npmjs.org/install.sh -L | sudo sh" – iwan Apr 24 '14 at 00:04