How to globally install NodeJs packages without sudo in Linux and macOS

A lot of Linux and macOS newcomers to NodeJs got a problem with NPM installer: Either run npm install -g <package_name> under sudo privilege or install the package locally to the project (under node_modules folder) and call it via full path or npx. Fortunately, there’s a simple workaround that takes you less than a minute […]