On Ubuntu, if I install a module like:
npm install nodemon -g
I have the command nodemon
in the $path
On Mac OSX, nodemon
is not in $path
...
Any clues?
UPDATE: there is nothing /usr/local/bin
, I also tried the same result with npm install nodemon -g
js main executables files -- node and npm -- are located on the /usr/local/bin folder.
The easiest way to know where the global modules are installed is to run the npm list -g command. On macOS computers, npm will be installed under /usr/local/bin/npm soft link path. The actual path to the npm package is under /usr/local/lib/node_modules . Any globally installed packages will end up in that path as well.
Fix npm command not found error on macOS or Linux First, you need to uninstall npm using the same method you installed it. If you use a package manager like Homebrew, then use brew uninstall node to remove it. Then you can install your NodeJS and npm using brew install node command.
On your Mac, click the Finder icon in the Dock to open a Finder window. Choose View > Show Path Bar, or press the Option key to show the path bar momentarily. The location and nested folders that contain your file or folder are displayed near the bottom of the Finder window.
Try installing it globally:
sudo npm install nodemon -g
If that doesn't work either, add /usr/local/bin
to your $PATH
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With