Recently I posted on how globally installed node packages are added to the Windows command prompt. Today I look at the same for Mac.
Unlike on Windows, there is no output for “whereis ng”. Examining the path (“echo $PATH”) provides /usr/local/bin. In this folder are many links, including many for node packages. For example, npm links to “../lib/node_modules/npm/bin/npm-cli.js”.
This is an “executable” script file. In this case JavaScript, which is run by node via the first line of the script “#!/usr/bin/env node”
Thus the full path to the global packages are in /usr/local/lib/node_modules, and the commands are linked from the path /usr/local/bin.