Having trouble installing NPM Live-server on zsh shell?

As I attempt to globally install live-server using the command: npm install -g live-server, I continue to encounter the following error message;

mac@Edozie ~ % npm install -g live-server
npm WARN deprecated <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="80e3e8efebe9e4e1f2c0b2aeb1aeb8">[email protected]</a>: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b9d6c9d7f98f97899789">[email protected]</a>: The package has been renamed to `open`
npm WARN deprecated <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="94f2e7f1e2f1fae0e7d4a5baa6baa5a7">[email protected]</a>: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="deacbbadb1b2a8bbf3abacb29eeef0ecf0ef">[email protected]</a>: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1560677c6d55253b243b25">[email protected]</a>: 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!   stack: "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/mac/.npm/_logs/2020-07-30T04_56_32_406Z-debug.log

Despite diligently following the tutorial steps for installation, I am still unable to proceed due to this recurring message. Any insights on what might be causing this obstacle?

Answer №1

My suggestion would be to potentially correct the issue by adjusting the permissions of your /usr/local/lib/node_modules directory:

sudo chmod -R 775 /usr/local/lib/node_modules

However, I must caution that making changes in the /usr/local/lib path can lead to unintended consequences, so proceed with caution.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The initial res.body object in NodeJS is enclosed in quotation marks

I've hit a roadblock while working on my social media website project using the MERN stack. Despite scouring the internet, I haven't been able to find a solution to the issue at hand. While following an online course, I encountered a problem tha ...

Exploring cross-site session management using a NodeJS/Passport/Express backend integrated with a Polymer frontend

Currently, I have a node/express/passport backend running on port 3001 that I am accessing directly from the browser for authentication purposes. It successfully authenticates and manages access to protected URLs. The frontend is built using Polymer and is ...

The node.js system automatically restarts an API call when a timeout occurs

Current Setup: I am using a combination of sails.js for the backend API and React for the frontend. The communication between the frontend and backend is handled by the fetch API. Scenario: Within some of my API endpoints, I need to run an external file ...

Upon inserting Node 5, an error with the code EINVALIDTYPE occurred in npm

Recently, after I upgraded to Node 5, I've been encountering an error in the terminal every time I try running anything with npm. npm -v: 2.14.12 Desperately attempting to update npm to the latest version: MacBook-Pro-de-MarceloRS:promo-auto-loan ...

What is the purpose of running NPM install to install all node_modules?

Every time I attempt to install just one module into my project, such as gulp, it ends up installing all the node_modules... I'm puzzled as to where these extra modules are originating from, as I end up with around 99 folders in the node_modules fold ...

Unable to use npm for installation of node packages

When attempting to install a node package using npm, I encountered this error message: C:\Users\460785>npm install express -g npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files ...

Utilize express/node to iterate through requests sent to the NOAA API

I have developed an API middleware for my company to pull information from the NOAA API and store it in my database. The process works as expected, but the challenge arises when trying to handle information based on zip codes one at a time. Each request fe ...

What are the steps for deploying an Angular 2 project to a server with PUTTY?

After developing an Angular 2 app with Angular-CLI on my local server, I have reached the production phase and now need to upload it to a CentOS server using Putty. I attempted to follow instructions from this source for installing node and npm on the ser ...

"Struggling with MeanJs: How do I properly POST data and why aren't the service actions triggering as expected

Seeking guidance on Angular, Express, and MeanJs as a beginner. Looking for assistance in posting data and receiving responses. I'm trying to execute a Complile function to send code from a text box to the server, process it, and get a response. Howev ...

npm sinopia installation failed - there was an error during the installation

When attempting to globally install sinopia for electron updater, I encountered the following error: npm install -g sinopia npm WARN deprecated <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f69b9f989f9b9782959eb6c7d8c6d8c ...

Unfortunately, the utilization of an import statement outside a module is restricted when working with Electron

Is there a solution to the well-known problem of encountering the error message "Cannot use import statement outside a module" when working with an Electron-React-Typescript application? //const { app, BrowserWindow } = require('electron'); impor ...

What sets "font-awesome" apart from "components-font-awesome"?

Can you explain the distinction between "font-awesome" and "components-font-awesome"? In your opinion, which one is better to use? ...

Monitoring modifications to fields with the help of mongoose.js

One thing I'm trying to figure out is how to effectively monitor changes to fields while using mongoose.js. Specifically, whenever the name field on an object is set, I want to create a new entry in that object's history (as an embedded document) ...

Inserting an HTML element into Handlebars.js during a specific iteration of an each loop

I have a channel.json file containing 7 objects of data which are iterated in hb. I am looking for a way to insert a date between these iterations without modifying the .json file. How can I add an html tag to display after the 3rd iteration within the loo ...

I'm facing a frustrating issue where using NodeJS with the Passport local strategy is resulting

I am experiencing a severe headache when attempting to log in using Passport. When I make a post request to /login with an email and password, Passport successfully authenticates it without any errors. However, the return res.redirect('/user') fu ...

Updating an object within an array stored in a MongoDB Collection through Mongoose: A Step-by-Step Guide

This Application Helps You Keep Track of Your Expenses I am in the process of creating an update route that will allow users to modify expense values For instance, I would like to change the name of the first expense from Bike to Bike Rental and adjust t ...

Guide on transferring data between MongoDB collections using distinct identifiers

I'm currently working on merging documents from another collection into the documents that need to be returned. For instance: { msg: "success", data:[ { _id: "61d97498dc11d6d80db7212e", feedbackTitle: "Testing", comme ...

Utilizing Node.js, Express, Jade, and Templates within a single package

Can templates for an express application be stored in a separate package? In my scenario, I am interested in having a shared package that contains global templates to ensure all apps have a consistent look and feel, even if they are running independently ...

Can you explain the distinctions between Rundeck and Quartz in terms of their job scheduling capabilities?

In my quest for a job scheduler compatible with both node.js and Rundeck, I stumbled upon Quartz. However, despite my efforts to grasp the differences between Quartz and Rundeck, I find myself at a loss. Any assistance on this matter would be immensely a ...

Guide to successfully downloading an xlsx file in angular through express

I am creating an xlsx file based on user input within the express framework. The data is sent via a post request and I intend to send back the file content using res.download(...). However, when I do this, the data field in my ajax response ends up contai ...