I'm trying to run apps script locally using clasp. I'm following https://github.com/google/clasp/blob/master/docs/run.md to get set up . I'm logged in. Foolowing the directions:
$ clasp login
Logging in globally...
� Authorize clasp by visiting this url:
https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&scope=https%3A%2F%2Fwww.google........
Authorization successful.
Default credentials saved to: ~\.clasprc.json (C:\Users\me\.clasprc.json).
$ clasp open --creds
error: unknown option `--creds'
My project files are on the E drive.
If you are to lazy to clone the clasp project, build it to finally use the --creds option, you can just open the url:
https://console.developers.google.com/apis/credentials?project=...
with the parameter project with a value like: project-id-7006438181792679938
The ability to clasp open --creds was added in commit 0cd4d12. This commit came after the current release of 1.7.0
If you are not self-compiling clasp, then you do not have this functionality yet. To compile clasp, review the developer guide.
Related
I have cloned a google apps script project but when trying to deploy the changes with the push command I get the following error:
PS D:\evcPRD> clasp push
No valid D:\evcPRD.clasp.json project file. You may need to create or clone a project first.
Any idea how to solve this?
Thank you
I'm using clasp to develop google app scripts projects with Visual Studio Code under various google accounts. So whenever I switch project to work on, I might need to logout from the current account - clasp logout ,and clasp login in to another account.
Is there a way to check what is the current account clasp is logged in?
You can use command
clasp login --status
Example:
$ clasp login --status
You are logged in as user#domain.com.
I am able to get the files using clasp pull command but not able to update the files using clasp push command. It says "No files to push".
When I run command clasp status then it shows all of my project files in "Ignore files". Previously it was working completely and the problem occurred yesterday when I changed my laptop.
I also tried making .claspignore file and it also did not work.
For reference, please see the screenshot.
Please help.
I think for me I found the issue after using trying
clasp version "YOUR_VERSION_STRING".
I got a console message to enable API access. Once I enabled that I was able to make pushes. It's funny because I was able to clone and pull just fine.
So this is the Settings URL and then make sure that "Google Apps Script API Access" is on.
I'm logging in with clasp login --creds <file> which produces a local .clasprc.json file.
It says that I am logged in, but when I run another command I get:
Could not read API credentials. Are you logged in globally?
Any thoughts on why its not looking at my local clasprc file first?
Currently using version clasp v. 2.2.0
I ran into the same problem on Windows 10 and found that you need to login both globally and locally to use clasp run. There should be a .clasprc.json file in both your project folder and user folder.
I think I have finally found the solution for the same problem
Follow along with the comments from this github issue
Add the "oauthScopes" field to your local code and push it to your app
If you can't push, then copy-paste it to manifest file in the browser
Then you have to publish the app, and there were few things I've done, not sure which one helped. In the app in browser:
add the app version in File->Manage Versions
Publish -> Deploy as API executable
try to login with clasp and creds.json file
try to run something clasp run testRun
it may show the error that you're missing some oauth permissions, but it will list which ones, and you can add them
In my case, one weird thing that also helped was to enable some Google API
so in the app in browser: Resources -> Advanced Google Services -> enable some API
then try to do clasp run
if it works, you can disable the API that you have enabled previously.
Hope that helps
I'm trying to locally run apps script after installing clasp. So far I have logged in and pulled the scripts locally. Now following https://github.com/google/clasp:
$ clasp login
Logging in globally...
� Authorize clasp by visiting this url:
https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&scope=https%3A%2F%2Fwww.googleapis.com%2Fai
Authorization successful.
Default credentials saved to: ~\.clasprc.json (C:\Users\me\.clasprc.json).
$ clasp run testGET
Error: Local client credentials unauthenticated. Check scopes/authorization.
What am I doing wrong?