Search code examples
bashnpmosx-yosemite

npm already installed but then says "command not found"


I keep having this problem so I uninstalled homebrew and tried to uninstall npm, but it did not work. I installed homebrew again and then typed "brew install npm." It returned "Warning: node-0.12.7 already installed." I then tried to use npm with the following command: "npm install -g mup" and it returned "-bash: npm: command not found."

I have trouble uninstalling npm because on the site it uses npm to uninstall npm... Otherwise, it denies me permission. How can I get around this so that I can install mup with "npm install -g mup"? What's weird is that it was working earlier but now it is failing me. Thank you.


Solution

  • Try this

    cd ~
    sudo rm -rf .npm
    brew update
    brew uninstall npm
    brew install npm