I upgraded to 1.7.0 from 1.5.3 today with sudo npm update -g @google/clasp. Running any clasp command now throws the following error -
Error retrieving access token: TypeError: Cannot read property 'expiry_date' of undefined
I tried logging out and logging back in. Got another error -
$ clasp login
Warning: You seem to already be logged in *globally*. You have a ~/.clasprc.json
$ clasp logout
$ clasp login
Logging in globally...
Authorize clasp by visiting this url:
https://accounts.google.com/o/oauth2/v2/auth?...
Authorization successful.
/usr/local/lib/node_modules/@google/clasp/node_modules/dotf/index.js:39
fs.chmodSync(fullpath, fs.constants.S_IRUSR | fs.constants.S_IWUSR);
^
TypeError: Cannot read property 'S_IRUSR' of undefined
at jsonfile.writeFile (/usr/local/lib/node_modules/@google/clasp/node_modules/dotf/index.js:39:46)
at /usr/local/lib/node_modules/@google/clasp/node_modules/graceful-fs/graceful-fs.js:111:16
at /usr/local/lib/node_modules/@google/clasp/node_modules/graceful-fs/graceful-fs.js:45:10
at FSReqWrap.oncomplete (fs.js:117:15)
What's your Node version?
Can you fill out the issue template?
This happened to me today but after logout and login again it worked
Happened to me too. This is obviously a breaking change.
Pre-1.7 .clasprc.json:
{
"access_token": "****",
"scope": "****",
"token_type": "****",
"expiry_date": 1545361708619,
"refresh_token": "****"
}
1.7 .clasprc.json
{
"token": {
"access_token": "****",
"refresh_token": "****",
"scope": "****",
"token_type": "****",
"expiry_date": 1545366408997
},
"oauth2ClientSettings": {
"clientId": "****",
"clientSecret": "****",
"redirectUri": "****"
},
"isLocalCreds": false
}
Yeah, at that point I broke the credential file to accommodate for login 鈥攃reds easily.
I really should have bumped the major version at that point.
Will need to do that at some point. But yes, logout and login to fix.
@grant I'm still seeing https://github.com/google/clasp/issues/457#issuecomment-447238670
Node - v6.2.2
Clasp - 1.7.0
OS - Linux/Ubuntu 14.04.5 LTS
I'm going to move on and close this issue.
Please login again to fix the problem.
See this comment for the reason why the problem exists if your curious:
https://github.com/google/clasp/issues/457#issuecomment-449252592
Most helpful comment
Yeah, at that point I broke the credential file to accommodate for login 鈥攃reds easily.
I really should have bumped the major version at that point.
Will need to do that at some point. But yes, logout and login to fix.