Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: opt.init is not a function #1

Open
bestony opened this issue Feb 4, 2017 · 1 comment
Open

TypeError: opt.init is not a function #1

bestony opened this issue Feb 4, 2017 · 1 comment

Comments

@bestony
Copy link

bestony commented Feb 4, 2017

C:\Users\Bestony\Desktop\cos\node_modules\cos-sdk\lib\util.js:37
    opt.init(defaultValue);
        ^

TypeError: opt.init is not a function
    at initOpt (C:\Users\Bestony\Desktop\cos\node_modules\cos-sdk\lib\util.js:37
:9)
    at Object._signUrl (C:\Users\Bestony\Desktop\cos\node_modules\cos-sdk\cos.js
:129:21)
    at Object.request (C:\Users\Bestony\Desktop\cos\node_modules\cos-sdk\cos.js:
155:24)
    at Object.listBucket (C:\Users\Bestony\Desktop\cos\node_modules\cos-sdk\lib\
api\bucket.js:41:10)
    at Object.exports.list [as lsBucket] (C:\Users\Bestony\Desktop\cos\node_modu
les\cos-sdk\lib\api\bucket.js:107:16)
    at Object.<anonymous> (C:\Users\Bestony\Desktop\cos\app.js:9:5)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)

代码

var Cos = require("cos-sdk"); 
var cos = new Cos({
    accessId: "", 
    secretId: "",
    secretKey: "" 
});
cos.lsBucket(function(e) {
    console.log(e);
});
@fakaka
Copy link

fakaka commented May 5, 2017

我也是。。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants