D
D
Dubolom Unicellular2020-02-06 15:46:53
macOS
Dubolom Unicellular, 2020-02-06 15:46:53

Why is node js not working?

I tried to install browser-sync via npm (on macOS). I wrote in the console:

npm install -g browser-sync

BUT, npm refused to download it to the end, the download stopped somewhere around 65% and the following was displayed:

npm ERR! code EACCES
npm ERR! syscall symlink
npm ERR! path ../lib/node_modules/browser-sync/dist/bin.js
npm ERR! dest /usr/local/bin/browser-sync
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/browser-sync/dist/bin.js' -> '/usr/local/bin/browser-sync'
npm ERR! [OperationalError: EACCES: permission denied, symlink '../lib/node_modules/browser-sync/dist/bin.js' -> '/usr/local/bin/browser-sync'] {
npm ERR! cause: [Error: EACCES: permission denied, symlink '../lib/node_modules/browser-sync/dist/bin.js' -> '/usr/local/bin/browser-sync'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: '
npm ERR! path: '../lib/node_modules/browser-sync/dist/bin.js',
npm ERR! dest: '/usr/local/bin/browser-sync'
npm ERR! },
npm ERR! stack: "Error: EACCES: permission denied, symlink '../lib/node_modules/browser-sync/dist/bin.js' -> '/usr/local/bin/browser-sync'",
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../lib/node_modules/browser-sync/dist/bin.js',
npm ERR! dest: '/usr/local/bin/browser-sync'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/user/.npm/_logs/2020-02-06T12_39_46_249Z-debug.log

Then I decided to check what npm can do at all, but it ignores all commands, issuing ERR or WARN. Rummaged all Internet since yesterday, no commands work. Reinstalled 3 times, normal and Current version. Useless.

I tried to install not globally, and the terminal wrote:
browser-sync is not a command

In short node herachit my brains.

HOW TO FIX IT?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alex, 2020-02-06
@duboloms

https://stackoverflow.com/questions/47252451/permi...
https://www.willandskill.se/en/how-to-fix-eacces-e...

S
slaxik123, 2020-02-06
@slaxik123

npm ERR! Error: EACCES: permission denied,
use with sudo
when installing packages via npm globally needs admin rights,
sudo npm install -g browser-sync

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question