Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Every single time I try to use npm in zsh it asks me if I meant nm. It's gotten very annoying now. I like the auto correct feature, though. How can I turn it off for the npm command?

share|improve this question
1  
Zsh wouldn't autocorrect if it noticed that npm was a valid command. Why doesn't it think that it's a valid command? Is this an installed executable in your $PATH? Do you have execution permissions on it? – Gilles Mar 27 '12 at 20:15
up vote 5 down vote accepted

If you've just installed npm and you're still running a zsh instance from before the installation, run hash -rf to rebuild the command cache (or more precisely hash npm). Instances of zsh started after the installation will pick up this command when they build their cache.

share|improve this answer

You could put:

alias npm='nocorrect npm'

in your profile script. Not very pretty but effective.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .