Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while trying to retrieve access token, ENOENT: no such file or directory, mkdir '\Users\my\.credentials\' #223

Open
rubyzhao opened this issue Nov 12, 2019 · 0 comments

Comments

@rubyzhao
Copy link

rubyzhao commented Nov 12, 2019

Config / CLI options

pwmetrics --config=pwmetrics-config.js

Errors

Error while trying to retrieve access token, ENOENT: no such file or directory, mkdir '\Users\my.credentials'

Error while trying to retrieve access token, invalid_grant at GoogleOauth.getNewToken

Solution

After digging out in google-oauth.js, change the line as below:

//this.tokenDir = path.join((process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE), '/.credentials/'); // Original 
this.tokenDir = path.join((process.env.USERPROFILE || process.env.HOME || process.env.HOMEPATH), '/.credentials/');

Reason:
tokenDir in the original line is equal to \Users\username\.credentials\
tokenDir in the new line is equal to C:\Users\username\.credentials\ , which is the right for Windows.

Environment

  1. pwmetrics version: 4.2.2
  2. Chrome version: Version 78.0.3904.97 (Official Build) (64-bit)
  3. OS version: Win10X64 1803
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant