sudo: npm: command not found

seleniumをインストールしようとしたところ、command not foundと表示されてしまいました。

npmをインストールしなくてはならないようです。

% sudo npm -g install selenium-webdriver
sudo: npm: command not found

% sudo port install npm
--->  Computing dependencies for npm
--->  Fetching archive for npm
--->  Attempting to fetch npm-2.9.0_0.darwin_14.noarch.tbz2 from http://jog.id.packages.macports.org/macports/packages/npm
--->  Attempting to fetch npm-2.9.0_0.darwin_14.noarch.tbz2 from http://packages.macports.org/npm
--->  Attempting to fetch npm-2.9.0_0.darwin_14.noarch.tbz2.rmd160 from http://packages.macports.org/npm
--->  Installing npm @2.9.0_0
--->  Activating npm @2.9.0_0

It is not recommended to install packages globally. But if you do so please be aware that they won't get cleaned up when you deactivate or uninstall npm. Globally installed packages will remain in
/opt/local/lib/node_modules/ until you manually delete them.

--->  Cleaning npm
--->  Updating database of binaries
--->  Scanning binaries for linking errors
--->  No broken files found.

無事、インストールできました。

I have installed nodejs but the npm command is not working? - Ghost.org