错误源自下面这一行,因为我正确地遵循了示例(https://www.npmjs.org/package/aws-sign),所以它没有意义。如有任何提示,不胜感激。
var signer = new AwsSign({
accessKeyId: 'AKIAIO7EXAMPLE',
secretAccessKey: 'bPxRfiCYEXAMPLEKEY',
});
误差 Caught unhandled exception: Not a string or buffer TypeError: Not a string or buffer
at exports.createHmac (crypto.js:138:21)
at hmacSha1 (/rhel5pdi/workplace/jamiey/jamiey-awsProject/src/awsProject/node_modules/aws-sign/index.js:62:17)
at sign (/rhel5pdi/workplace/jamiey/jamiey-awsProject/src/awsProject/node_modules/aws-sign/index.js:77:10)
at new authorization (/rhel5pdi/workplace/jamiey/jamiey-awsProject/src/awsProject/node_modules/aws-sign/index.js:47:39)
此错误与字符串缓冲区无关。这是由于没有正确安装模块造成的。再次检查以确保模块已安装。