clasp icon indicating copy to clipboard operation
clasp copied to clipboard

clasp login` fails with `--creds` option

Open saito-ya opened this issue 5 years ago • 2 comments

(Note: Non-breaking issues are likely not to be prioritized. Please consider a PR in addition to your issue)

Expected Behavior

Success clasp login --creds creds.json and it is able to log in with my own credential.

Actual Behavior

Run clasp login --creds creds.json and get the following error message.

Logging in locally...

No valid .clasp.json project file. You may need to `create` or `clone` a project first.

Steps to Reproduce the Problem

  1. Go to APIs & Services > Credentials of my GCP project.
  2. Create OAuth 2.0 Client IDs (with type of Desktop)
  3. Download the credential json file
  4. run npm i clasp -g and install clasp globally
  5. run clasp login --creds path_to_credential.json

Specifications

  • Node version (node -v): v12.13.0
  • Version (clasp -v): 2.3.0
  • OS (Mac/Linux/Windows): Mac

saito-ya avatar Jun 16 '20 08:06 saito-ya

@saito-ya can you test with the #791 unofficial release?

npm uninstall -g @google/clasp && npm install -g forked-clasp
clasp --version
# should be 2.4.0 or more

PopGoesTheWza avatar Jul 15 '20 19:07 PopGoesTheWza

Intended behavior to require an existing project. --creds is really only used to set up auth for the run command and it does some other things in the associated GCP project.

Since it's a bit more specialized than the login command implies, may revisit this in 3.0 and break it out to a separate command to configure the run command.

sqrrrl avatar May 26 '21 18:05 sqrrrl