node.js - npm install -g firebase-tools 导致错误
问题描述
我正在尝试运行:npm install -g firebase-tools
在我的终端上以使用 firebase 功能。
但是当我这样做时,我得到以下错误输出:
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
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 (though this is not recommended).
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/myusername/.npm/_logs/2019-05-21T19_11_21_252Z-debug.log
我一直在经历这个。和他们推荐的事情要做,但我是。要么误解了说明,要么他们只是不工作。
我在做什么:
- 跑步:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
- then:
command -v nvm
有时什么也不返回,有时返回nvm
即使是这种情况,但是运行 firebases 行失败
我该如何解决这个问题?
解决方案
推荐阅读
- javascript - 无法设置未定义的属性“functionName”
- bash - 无法通过 bash 创建 IAM 访问密钥
- python - Conda 和 Anaconda 都在 Windows 机器上。Jupyter notebook 无法导入 Python 包
- java - 我的方法的 JUnit 测试
- timer - 用于隐藏和显示表单的计时器算法
- php - Laravel 5.4 显示属于用户的结果
- html - 如何将图像和水平菜单对齐在同一行?
- symfony - Symfony4/Twig/AbstractTypeExtension:无法覆盖文件小部件以显示存储在实体和数据库中的图片
- java - Pojo 到 DTO - Bean 映射
- javascript - 如何为我的网站实现分页?