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

The Future of AI, LLMs, and Observability on Google Cloud

Datadog sat down with Google’s Director of AI to discuss the current and future states of AI, ML, and LLMs on Google Cloud. Discover 7 key insights for technical leaders, covering everything from upskilling teams to observability best practices

Learn More

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

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay