STL34
STL34

Reputation: 355

Installing npm live-server on MacOS Catalina

I'm trying to install npm live-server but I am getting the following errors:

stl34>>npm install live-server -g    
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: The package has been renamed to `open`
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!  [Error: EACCES: permission denied, access '/usr/local/lib/node_modules'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
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/stl34/.npm/_logs/2020-08-10T22_30_11_210Z-debug.log

The issue seems to be that the file permissions for /usr/local/lib/node_modules need to be changed. I tried restarting in recovery mode and typing into the terminal:

csrutil disable

to disable SIP. Then I restarted and entered the following into the terminal:

sudo mount -uw /

chmod 775 usr/local/lib/node_modules

But the system still will not allow me to modify the file permissions. What can I do to modify them?

Another user asked this same question here: NPM Live-server not installing on zsh but received no answers.

Upvotes: 1

Views: 1235

Answers (1)

Yegon Moses
Yegon Moses

Reputation: 46

running "sudo npm install live-server -g" worked for me

Upvotes: 3

Related Questions