I am using Clasp to clone code from a Google Apps Script project to a project on my local machine. The cloning works fine, and the code from the GAS project is now present in my VS Code folder. However, when I make a change and try to push it to the original GAS project, I get the following error:
No valid /Users/iancampbell/Desktop/GAS/test_gas/.clasp.json project file. You may need to
createorclonea project first.
I am confused by this error, because my project very clearly has a .clasp.json file, and I have just cloned a project. The .clasp.json file also has the same script ID I used to clone.
I also tried running the command from the apps-script folder as well, and that made no difference.
Here is what my package.json looks like:
{
"name": "test_gas",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"delete": "del-cli --force ./apps-script",
"folder:": "mkdir apps-script",
"glogin": "clasp login",
"glogout": "clasp logout",
"gcreate": "clasp create --title 'React Test Project' --rootDir './apps-script' ",
"gclone": "clasp clone 1YNAbrnPfOdXFKKuEO90JxnWZ0x9njHa3zlb3s3O8_pdBCc6OpoWuD3Gc --rootDir ./apps-script",
"gpull": "clasp pull",
"gpush": "clasp push ",
"gstart": "clasp push --watch",
"start": "parcel src/index.html --dist-dir ./apps-script",
"build": "parcel build src/index.html --dist-dir ./apps-script",
"runall": "npm-run-all delete folder gclone"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@google/clasp": "^2.4.2",
"@types/google-apps-script": "^1.0.62",
"multi-clasp2": "^3.0.10"
},
"dependencies": {
"del-cli": "^5.0.0",
"npm-run-all": "^4.1.5"
}
}
When I used clasp create, this issue does not happen. But when I clone an existing GAS project and then try to update it, this error continues to appear. Is there a different npm command I should run?
