aliyun-UED / aliyun-sdk-js

阿里云 SDK for Javascript,支持在浏览器和 Nodejs 环境使用,支持大部分阿里云服务。
http://www.aliyun.com
778 stars 198 forks source link

TypeError: sts.assumeRole is not a function #182

Open atrun opened 5 years ago

atrun commented 5 years ago

TypeError: sts.assumeRole is not a function at d:\H5\vh5\server.js:64:7 at Layer.handle [as handle_request] (d:\H5\vh5\node_modules\express\lib\router\layer.js:95:5) at next (d:\H5\vh5\node_modules\express\lib\router\route.js:131:13) at Route.dispatch (d:\H5\vh5\node_modules\express\lib\router\route.js:112:3) at Layer.handle [as handle_request] (d:\H5\vh5\node_modules\express\lib\router\layer.js:95:5) at d:\H5\vh5\node_modules\express\lib\router\index.js:277:22 at Function.process_params (d:\H5\vh5\node_modules\express\lib\router\index.js:330:12) at next (d:\H5\vh5\node_modules\express\lib\router\index.js:271:10) at SendStream.error (d:\H5\vh5\node_modules\serve-static\index.js:120:7) at SendStream.emit (events.js:189:13)

atrun commented 5 years ago

STS坑多呀,但还是解决了。

改了两处就可以用了。

apiVersion: '2015-04-01'

// 构造AssumeRole请求
sts.assumeRole({ Action: 'AssumeRole', RoleArn: roleArn,

要加“Action”