Common issues Frontend Developers run into

1. Using ‘sudo’ with ‘npm install’ Why can’t I npm install nodemon or supervisor on OSX 10.8.4?

Update: Finally npm has updated the instructions to fix the npm permission errors, click here to know more.

  • Often times when installing an npm package, you might have encountered EACCES errors.
  • They result primarily because of directory permissions
  • To curb it, people go with sudo which is not advisable. Using sudo with npm install is potentially unsafe
  • There are solutions like npm cache clean. But cache clean do not address the root cause.


This issue is with the ownership of the npm packages directory

i.e. /usr/local/lib/node_modules/*.

To solve the issue, you need to set the ownership on the npm packages directory and its parent i.e. /usr/local/ directory to yourself i.e. the admin user:

sudo chown -R $USER /usr/local
sudo chown -R $USER ~/.npm

  • In some of the cases you may face similar EACESS issues, not with the NPM’s node_module cache, but in your own project folder. In such a case, just
sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}

You may encounter the following issue even after doing the above:
Insecure world writable dir /usr/local in PATH, mode 040777

If you still get errors like the one above from compass, you have to follow this link. If that doesn’t work out, re-install ruby, and compass.

2. Using ‘gitk’ from ‘cmd’ or ‘cmder’ on Windows

Unlike bash-compatible shells like mingw (comes with git for windows) or cygwin, some advanced command line tools like cmder can’t invoke 'gitk' straight away.

Solution is running gitk.cmd instead.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s