【问题标题】:npm ERR! The operation was rejected by your operating system [duplicate]npm 错误!该操作被您的操作系统拒绝[重复]
【发布时间】:2020-08-18 15:41:59
【问题描述】:
npm install -g create-react-app
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! 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/legend/.npm/_logs/2020-05-04T08_45_14_806Z-debug.log

【问题讨论】:

  • 这看起来像权限错误,您将在您没有权限的文件夹中安装npm模块的全局实例,您可以使用sudo。

标签: javascript reactjs ubuntu


【解决方案1】:

全局安装模块需要管理员权限,使用 sudo 运行命令:

sudo npm install -g create-react-app

【讨论】:

    猜你喜欢
    • 2020-07-04
    • 1970-01-01
    • 2021-03-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-02-14
    • 2018-10-26
    • 2020-07-10
    相关资源
    最近更新 更多