DEV Community

with Pyaar
with Pyaar

Posted on

1 1

Browser Sync Permissions Issue

When Downloading Node.js

How frustrating. Downloading and implementing programs these days take as much time as it does to write a complex code block. When downloading Node.js to install Browser Sync, a live reload application, I ran into a permissions issue. If you’re having trouble installing Browser Sync read on.

  1. Download Node.js
    on Browser Sync’s homepage, they have a “Get Started” button on the first third of the page, which will lead you to the download page for your operating system.

  2. Install Browser Sync
    The node package manager (npm) installs Browser Sync. Render the terminal and paste the following command.

npm install -g browser-sync

So Browser sync didn’t install?

If you have an EACCESS message, you may not be able to install the package because you’re not an authorized user. How-To Geek has a step-by step-guide on how to enable the root user.

When installing as the root user, you should be succesfull, however, I was not when I switched over to my regular user account. I still had the following permissions issue when running the browser sync command.

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/browser-sync

To fix this, change the global install directory using the npm config command below.

mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATH
That Should do it 🙂

  1. Start Browser Sync Run a command to see where you are in the terminal, like “whoami” (displays username of the current user) or “cd” (changes the directory you are in) to adjust the following to lead to a directory in which you have an “index.html” file.

browser-sync start --server --files "css/*.css"

I hope this helps! More information can be found on Github here: http://npm.github.io/installation-setup-docs/installing/a-note-on-permissions.html

Image of Datadog

How to Diagram Your Cloud Architecture

Cloud architecture diagrams provide critical visibility into the resources in your environment and how they’re connected. In our latest eBook, AWS Solution Architects Jason Mimick and James Wenzel walk through best practices on how to build effective and professional diagrams.

Download the Free eBook

Top comments (0)

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay