How to Prevent Permissions Errors
How to Prevent Permissions Errors
Back-up your computer before you start.
Make a directory for global installations:
1
mkdir ~/.npm-global
Configure npm to use the new directory path:
1
npm config set prefix '~/.npm-global'
Open or create a ~/.bashrc file and add this line:
1
export PATH=~/.npm-global/bin:$PATH
Back on the command line, update your system variables:
1
source ~/.profile
Test: Download a package globally without using sudo.
1
npm install -g jshint