Skip to content

'clasp list' Shows ' EPERM: operation not permitted' Error When Installed as None Admin User #409

Closed

Description

@bv-vd

Expected Behavior

clasp list should list projects

Actual Behavior

Showing error message
Error retrieving access token: Error: EPERM: operation not permitted, open '%USERPROFILE%.clasprc.json'

Fixed by change the permission of '.clasprc.json' file from 'read only' to 'read-write'

Steps to Reproduce the Problem

  1. Install nodejs (with npm) from the zipped package to %USERPROFILE% folder (as Windows local user, not admin)
  2. npm install clasp (and verify)
  3. run clasp list
  4. Error message shown
  5. Examine the permission of .clasprc.json file, it should be 'read only'
  6. Uncheck the 'read only' option
  7. run clasp list again. Issue should be gone

Specifications

  • Node version (node -v): v11.2.0
  • Version (clasp -v): 1.6.3
  • OS (Mac/Linux/Windows): Windows 10 v1803

Activity

  1. grant commented on Nov 20, 2018

    @grant
    Contributor

    OK. I'm not sure why .clasprc.json when writing the file. Maybe an issue here: https://github.com/grant/dotf/blob/master/index.js#L37
    PRs welcome to dotf.

    It seems like a Windows issue too.

  2. prprhyt commented on Nov 21, 2018

    @prprhyt
    Contributor

    It seems like a Windows issue too.

    I think too.
    chmod/chmodSync occurred to unexpected behavior in Windows.
    So, I suggest that we should modify dotf to prevent executing chmodSync when dotf is running on Windows.

    See:
    nodejs/node-v0.x-archive#4812

  3. grant commented on Nov 21, 2018

    @grant
    Contributor

    That looks like a very old issue in Node.

  4. prprhyt commented on Nov 21, 2018

    @prprhyt
    Contributor

    That looks like a very old issue in Node.

    Oops. I'm sorry.

    I found description about mode of fs.chmod() on Windows.

    @grant
    Do you think it is related to this issue?

    Caveats: on Windows only the write permission can be changed, and the distinction among the permissions of group, owner or others is not implemented.

    https://github.com/nodejs/node/blob/master/doc/api/fs.md#fschmodpath-mode-callback

  5. grant commented on Nov 24, 2018

    @grant
    Contributor

    @prprhyt @bv-vd Looks related to Windows/the linked issue.
    Can you make a PR to not chmod/chmodSync on Windows for dotf?

  6. prprhyt commented on Nov 24, 2018

    @prprhyt
    Contributor

    @grant
    OK. I'll give it a try!

  7. reopened this on Nov 25, 2018
  8. grant commented on Nov 25, 2018

    @grant
    Contributor

    @prprhyt I added dotf@1.2 that includes the patch you wrote.
    Can you try updating clasp with this version and see if the Windows issue is fixed?

  9. grant commented on Nov 26, 2018

    @grant
    Contributor

    @bv-vd The fix should be applied in the master branch of this repo. If you see it still occurring there, please reopen this issue.
    @prprhyt Created PRs to fix this issue.

  10. imthenachoman commented on Dec 10, 2019

    @imthenachoman

    I don't know if I should open a new issue but I was getting a similar error when I had hidden the .clasprc.json file through Windows.

    Error retrieving access token: Error: EPERM: operation not permitted, open 'C:\Users\nacho\.clasprc.json'
    

    I had to un-hide the file for it to work. Not sure why clasp run from PowerShell would need the file to be un-hidden?

  11. PopGoesTheWza commented on Dec 10, 2019

    @PopGoesTheWza
    Contributor

    @imthenachoman Looks like a NodeJS limitation: nodejs/node#14553
    Not sure yet how to implement a fix

  12. imthenachoman commented on Dec 10, 2019

    @imthenachoman

    @PopGoesTheWza Yeah. Very strange issue. I don't fully understand the technical reason but I assume it has something to do with how Microsoft did something. Oh well. Not a big deal.

  13. PopGoesTheWza commented on Dec 10, 2019

    @PopGoesTheWza
    Contributor

    I'd adventure a wild guess: Linux and Mac OS have similar POSIX compliant file systems which do not have an hidden attribute. Such attribute I only encounter on Microsoft OSes (DOS and Windows) and a few long since forgotten systems. In order to fully support Windows differences, one would need to either introduce in the NodeJS code base too much specific code, or leave up to apps and package developer to handle it.
    https://en.wikipedia.org/wiki/Hidden_file_and_hidden_directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions