1

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?

1
  • 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? Mar 27, 2012 at 20:15

2 Answers 2

6

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.

0

You could put:

alias npm='nocorrect npm'

in your profile script. Not very pretty but effective.

You must log in to answer this question.

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