我尝试使用 Google Cloud KMS 签署响应消息。
但立即得到一个错误。
index.js:
// Imports the Google Cloud client library
const kms = require('@google-cloud/kms');
exports.helloKms = (req, res) => {
let message = req.query.message || req.body.message || 'Hello World!';
res.status(200).send(message);
};
包.json:
{
"@google-cloud/kms": "^1.5.3",
"name": "sample-http",
"version": "0.0.1"
}
日志:
2019-12-01T05:26:37.534Z kms-demo Code in file index.js can't be loaded.
Did you list all required modules in the package.json dependencies?
Detailed stack trace: Error: Cannot find module '@google-cloud/kms'
....
2019-12-01T05:26:37.599Z Cloud Functions UpdateFunction us-central1:kms-demo boristep@googlemail.com INVALID_ARGUMENT E Cloud Functions UpdateFunction us-central1:kms-demo boristep@googlemail.com
任何想法?