【发布时间】:2020-03-03 05:06:20
【问题描述】:
我有一个 Google Apps 脚本项目,我正在尝试从 npm 或 yarn 脚本运行 clasp push。我可以从命令行运行clasp push,但是当用作脚本时,相同的命令会失败:
"scripts": {
"push": "clasp push"
}
当以npm run push 或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
【问题讨论】:
-
是本地安装还是全局安装 clasp?
-
本地安装和全局安装都试过了,结果一样
标签: google-apps-script npm-scripts clasp