commit d6e6be535f3da93d6680a66cfe88fd51b2a676bf Author: Brandon Scott Date: Fri Aug 16 14:45:36 2019 -0500 Create npm_eacces_errors.md diff --git a/npm_eacces_errors.md b/npm_eacces_errors.md new file mode 100644 index 0000000..60d3d87 --- /dev/null +++ b/npm_eacces_errors.md @@ -0,0 +1,32 @@ +# Resolving EACCES permissions errors when installing packages globally + +1. Back up your computer. +2. On the command line, in your home directory, create a directory for global installations: + + ``` + mkdir ~/.npm-global + ``` + +3. Configure npm to use the new directory path: + + ``` + npm config set prefix '~/.npm-global' + ``` + +4. In your preferred text editor, open or create a `~/.profile` file and add this line: + + ``` + export PATH=~/.npm-global/bin:$PATH + ``` + +5. On the command line, update your system variables: + + ``` + source ~/.profile + ``` + +6. To test your new configuration, install a package globally without using `sudo`: + + ``` + npm install -g jshint + ```