clasp
clasp copied to clipboard
Error retrieving access token: TypeError: Cannot destructure property 'client_id' of 'options.creds.installed' as it is undefined.
(Note: Non-breaking issues are likely not to be prioritized. Please consider a PR in addition to your issue)
Expected Behavior
Actual Behavior
Steps to Reproduce the Problem
Specifications
- Node version (
node -v
): - Version (
clasp -v
): - OS (Mac/Linux/Windows):
My case:
$ clasp login --creds .clasprc.json
Warning: You seem to already be logged in *locally*. You have a ./.clasprc.json
Logging in locally…
Authorizing with the following scopes:
https://www.googleapis.com/auth/script.container.ui
https://www.googleapis.com/auth/script
https://www.googleapis.com/auth/spreadsheets
https://www.googleapis.com/auth/script.webapp.deploy
NOTE: The full list of scopes your project may need can be found at script.google.com under:
File > Project Properties > Scopes
Error retrieving access token: TypeError: Cannot destructure property 'client_id' of 'options.creds.installed' as it is undefined.
It's really not clear what should I fix...
Another question:
How options.creds.installed
shall be defined in a local credentials file?
It is mentioned in:
https://github.com/google/clasp/blame/e851215b8abe4de282c62c4d61076c85e89a56ba/src/auth.ts#L113
I don't see any way to generate such .clasprc.json
with installed
property.
Same with node v14.18.2 clasp 2.4.1 on MacOs Big Sur 11.6.4
clasp login --creds .clasprc.json
Warning: You seem to already be logged in *locally*. You have a ./.clasprc.json
Logging in locally…
Authorizing with the following scopes:
https://www.googleapis.com/auth/spreadsheets
https://www.googleapis.com/auth/drive.readonly
https://www.googleapis.com/auth/script.webapp.deploy
NOTE: The full list of scopes your project may need can be found at script.google.com under:
File > Project Properties > Scopes
Error retrieving access token: TypeError: Cannot destructure property 'client_id' of 'options.creds.installed' as it is undefined.
Same for me.
node v12.20.1 clasp v2.4.2
clasp login --creds ./credentials/clasp-trn-creds.json  1 ↵  9012  12:16:18
Logging in locally…
Authorizing with the following scopes:
https://www.googleapis.com/auth/spreadsheets
https://www.googleapis.com/auth/script.scriptapp
https://www.googleapis.com/auth/script.container.ui
https://www.googleapis.com/auth/script.webapp.deploy
NOTE: The full list of scopes your project may need can be found at script.google.com under:
File > Project Properties > Scopes
Error retrieving access token: TypeError: Cannot destructure property 'client_id' of 'options.creds.installed' as it is undefined.
Almost the same issue here when trying clasp login --creds
with a service account key file.
I have added the installed
json key and got this error :
Error retrieving access token: TypeError: Cannot read properties of undefined (reading '0')
This answer helped me: https://stackoverflow.com/a/65456893/8668096 or this: https://stackoverflow.com/a/43640000
Still experiencing this. It's also not even clear from the documentation how to create an account locally, or the distinction between a local and global account.