NPM Live-server 未安装在 zsh 上 [英] NPM Live-server not installing on zsh

查看:68
本文介绍了NPM Live-server 未安装在 zsh 上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试通过以下方式在全球范围内安装 live-server:npm install -g live-server 但我一直收到下面的错误信息;

I have been trying to install live-server globally with: npm install -g live-server but I keep on getting the error message below;

mac@Edozie ~ % npm install -g live-server
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated opn@6.0.0: The package has been renamed to `open`
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: 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

我已按照教程中的每一步进行操作,我目前正在安装此软件,但我一直收到此消息.拜托,我错过了什么?

I have followed every step in the tutorial, I am currently watching to install this but I kept getting this message. Please, what am I missing?

推荐答案

这只是一个猜测,但修改/usr/local/lib/node_modules 的权限可能会修复安装:

It's just a guess, but modifying the permissions of your /usr/local/lib/node_modules might fix the install:

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

我之前通过修改/usr/local/lib 中的内容搞砸了事情,所以请自行决定使用.

I have messed things up before by modifying things in /usr/local/lib before though, so use at your own discretion.

这篇关于NPM Live-server 未安装在 zsh 上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆