Install npm packages globally without sudo

# Make a directory for global installations: $ mkdir ~/.npm-global # Configure npm to use the new directory path: $ npm config set prefix '~/.npm-global' #Open or create a ~/.bashrc file and add this line: $ echo 'export PATH=~/.npm-global/bin:$PATH' >>~/.bashrc #Back on the command line, update your system variables: source ~/.bashrc #Test: Download a package globally without using sudo. $ npm install -g gulp

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.