npm not found

This is to continue a comment thread I was having with a dev about not being able to get npm to work on OSX 10.8, which subsequently won't let me install the Titanium updates.

I've installed nodejs (multiple times,) and there is an npm file in /usr/local/bin but it just shows up as an alias with no source.

The last thing Chris, the dev, said to do was to echo $PATH which gave me:

1 Answer

  • Accepted Answer

    OK, so /usr/local/bin is in your path. You say that npm exists in /usr/local/bin when you run ls -l /usr/local/bin/npm. It should be a symlink to /usr/local/lib/node_modules/npm/bin/npm-cli.js.

    Does /usr/local/lib/node_modules/npm to exist? Does it contain a "bin" folder? Does the bin folder contain a npm-cli.js file?

    What happens if you just run node /usr/local/lib/node_modules/npm/bin/npm-cli.js -v from the command line? Does that work?

    — answered 3 years ago by Chris Barber
    • Well, Chris, turns out I'm more of a moron than I had hoped.
      /usr/local/bin had full permissions, but for some reason /usr/local/lib/ only had permissions on a different admin account. Changed that, and now everything works fine.

      Thanks for your help and patience!

      — commented 3 years ago by Ron Kirk
    • Cool. Glad to hear you got it working. Happy coding! :)

      — commented 3 years ago by Chris Barber