首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法安装json-server

无法安装json-server
EN

Stack Overflow用户
提问于 2021-11-23 12:52:45
回答 1查看 1.5K关注 0票数 3

我正在尝试安装,但它不起作用!

我使用了以下命令:npm install -g json-server

以下是错误消息:

代码语言:javascript
复制
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/json-server
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/json-server'
npm ERR!  [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/json-server'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: '/usr/local/lib/node_modules/json-server'
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.
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-11-23 13:06:06

在命令之前尝试使用sudo

sudo npm install -g json-server

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70081261

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档