我有一个 Google Apps 脚本项目,我正在尝试clasp push
从 npm 或 yarn 脚本运行。我可以从命令行运行clasp push
,但相同的命令在用作脚本时会失败:
"scripts": {
"push": "clasp push"
}
当作为npm run push
or运行时yarn push
,脚本将失败并显示输出> Did you provide the correct scriptId?
。如果我clasp push
直接在命令行上运行,它会成功地将我的项目文件推送到 Google Apps 脚本。
我已验证脚本在包含 .clasprc.json 和 appsscript.json 的同一目录中执行。这是完整的输出:
> @ push /gs
> cd build && ls -a && clasp push
. .. .clasp.json .clasprc.json appsscript.json build.gs
> Did you provide the correct scriptId?
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ push: `cd build && ls -a && clasp push`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ push script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
对于上下文,我正在尝试做类似于这篇博文的事情:https ://labs.clio.com/a-modern-gmail-add-on-build-process-3dd7aad111f5