npm - 为什么这段代码“npm install -g 动物区系壳”给我这个错误
问题描述
这是动物群中的 npm 错误。我使用了故障:
npm ERR! path /opt/nvm/versions/node/v12.0.0/lib/node_modules
npm ERR! > code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error:
> EACCES: permission denied, access
> '/opt/nvm/versions/node/v12.0.0/lib/node_modules'
npm ERR! [Error:
> EACCES: permission denied, access
> '/opt/nvm/versions/node/v12.0.0/lib/node_modules'] {
npm ERR! stack:
> 'Error: EACCES: permission denied, access ' + npm ERR!
> "'/opt/nvm/versions/node/v12.0.0/lib/node_modules'", npm ERR! errno:
> -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'access', npm ERR! path: '/opt/nvm/versions/node/v12.0.0/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!
> /tmp/npm-cache/12.0.0/_logs/2020-12-26T18_09_35_762Z-debug.log
解决方案
您正在运行该命令的用户没有 /opt/... 的安装权限
推荐阅读
- sql-server - 异常消息:无法绑定多部分标识符“item_t1.Code”
- sqlalchemy - 尝试使用 SQLAlchemy 将数据插入雪花数据库表
- timer - NetLogo 调度不同的动作
- arrays - 获取对象角度内对象的值
- sql - Postgresql - 复合键和两个表,还是只有 1 个宽表?
- swift - 如何将 tableView.row 与 NSStoryboardSegue 一起使用
- winapi - 具有关联 IOCP 的文件句柄的经典 OVERLAPPED-I/O
- javascript - 提交表单后如何重定向到 React 中的欢迎组件
- ruby-on-rails - Rails:删除添加依赖项之前创建的记录::destroy
- html - 图像对标题没有响应