Navigation

    云、贵、川、渝IT人的圈子
    • Register
    • Login
    • Search
    • 主页
    • 问答
    • 话题
    • 热门
    • 圈子
    • 招聘
    • 活动
    • 项目

    Error: EPERM: operation not permitted,

    技术答疑
    2
    2
    35
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • 无尽的思念
      无尽的思念 last edited by

      使用 fs-extra 模块对文件进行写入,失败,笔记本上没问题,公司台式机无法正常写入,这个如何处理,写入代码如下:

      let appYaml = `
      name:   test
      version:  1.0.0
      `
      fs.outputFile(`${this.apphome}/app.yaml`, appYaml)
      

      控制台报错信息

      Error: EPERM: operation not permitted, open 'F:\Users\admin\.test\app.yaml'
      
      1 Reply Last reply Reply Quote 0
      • Z
        zuxiongkao1 last edited by

        从字面上可以看出,应该是权限不足的问题,你可以尝试用管理员身份运行程序

        除此之外,还有一种情况,也就是你去写入了一个不是你的程序创建的文件,这种也有可能出现权限问题,解决的方案是尝试将该文件删除后,让程序重新写入就ok了!

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Z
        社
        8
        玻
        U
        A
        大