【发布时间】:2021-03-18 05:21:25
【问题描述】:
我正在尝试安装json-server,但一再失败,这让我感到绝望。现在需要帮助来解决问题。在我在 Ubunto-20.04 操作系统上使用的命令下方。
- 安装的 Nodejs 版本: v14.16.0
- 安装的 NPM 版本: 6.14.10
虽然首先,我使用了最新版本的nodejs 15x,但我也遇到了安装json-server的错误,下面的命令用于安装json-server
npm install json-server -gnpm install -g json-servernpm i json-server
我已经使用上述所有命令来安装json-server,但我每次都遇到错误,如下所示,
这里是错误
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! 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! /home/imdadul/.npm/_logs/2021-03-18T04_32_41_181Z-debug.log
【问题讨论】:
-
试试
sudo
标签: javascript json reactjs npm