how to install an npm package in terminal code example Example 1: install npm mac brew install node Example 2: how to install npm packages npm i <package>