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

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay