Error: EACCES: permission denied, access

Error: EACCES: permission denied, access

npm ERR! path /Users/apple/Documents/project/purchase-platform/AWPc/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/Users/apple/Documents/project/purchase-platform/AWPc/node_modules'
npm ERR!  {
    [Error: EACCES: permission denied, access '/Users/apple/Documents/project/purchase-platform/AWPc/node_modules']
npm ERR!  stack:
npm ERR!    'Error: EACCES: permission denied, access \'/Users/apple/Documents/project/purchase-platform/AWPc/node_modules\'',
npm ERR!  errno: -13,
npm ERR!  code: 'EACCES',
npm ERR!  syscall: 'access',
npm ERR!  path:
npm ERR!    '/Users/apple/Documents/project/purchase-platform/AWPc/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 (though this is not recommended).

解决办法:

  1. 首先添加sudo操作。
     sudo npm install
    
  2. 如果不行添加–unsafe-perm=true:
    sudo npm install --unsafe-perm=true
    
  3. 或许还是报错,添加–allow-root:
    sudo npm install --unsafe-perm=true --allow-root
    

相关推荐

最近更新

  1. TCP协议是安全的吗?

    2023-12-28 10:36:09       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2023-12-28 10:36:09       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2023-12-28 10:36:09       19 阅读
  4. 通过文章id递归查询所有评论(xml)

    2023-12-28 10:36:09       20 阅读

热门阅读

  1. 设计模式之状态模式

    2023-12-28 10:36:09       41 阅读
  2. Elasticsearch 常用 REST API 之集群APIs

    2023-12-28 10:36:09       32 阅读
  3. 【前端框架】NPM概述及使用简介

    2023-12-28 10:36:09       36 阅读
  4. 如何解决服务器CA证书过期的问题

    2023-12-28 10:36:09       44 阅读
  5. centos 7.9 安装 qt5.15.11

    2023-12-28 10:36:09       48 阅读
  6. 【后端】拷贝数据字典

    2023-12-28 10:36:09       40 阅读
  7. C# 基于事件的观察者模式

    2023-12-28 10:36:09       33 阅读
  8. Django信号机制源码分析(观察者模式)

    2023-12-28 10:36:09       41 阅读
  9. 基数(Radix)排序

    2023-12-28 10:36:09       36 阅读