小编Cha*_*mpa的帖子

twilio 错误“需要用户名”

var express = require('express');
var router = express.Router();
var bodyParser = require('body-parser');
var nodemailer = require('nodemailer');
var TWILIO_TOKEN = "270ff32fe16828869dc30e0c6926fa9e";
var client = require('twilio')(process.env.AC55a59221acb23a5aa6f046740bb73317, process.env.TWILIO_TOKEN);
router.use(bodyParser.urlencoded({extended: true}));
router.use(bodyParser.json());

router.post('/', function(req, res) {
    console.log('this is the req', req.body);
    client.messages.creat({
        to:'+19522209630',
        from:'+17633249718',
        body:'hello World'
    }, function(err, data) {
        if (err) {
            console.log('err', err);
            console.log('data', data);
        }
    });//en d of sendMessage
    res.send(200);
});

module.exports = router;
Run Code Online (Sandbox Code Playgroud)
/Users/moisesmiguelhernandez/Documents/prime/solo_project/node_modules/twilio/lib/rest/Twilio.js:101
    throw new Error('username is required');
    ^

Error: username is required
    at new Twilio (/Users/moisesmiguelhernandez/Documents/prime/solo_project/node_modules/twilio/lib/rest/Twilio.js:101:11)
    at initializer …
Run Code Online (Sandbox Code Playgroud)

javascript twilio

7
推荐指数
2
解决办法
1万
查看次数

模块“ pickle”没有属性“ dump”

import pickle

imelda = ('More Mayhem',
          'IMelda May',
          '2011',
          ((1, 'Pulling the Rug'),
           (2, 'Psycho'),
           (3, 'Mayhem'),
           (4, 'Kentish Town Waltz')))

with open("imelda.pickle", "wb") as pickle_file:
    pickle.dump(imelda, pickle_file)
Run Code Online (Sandbox Code Playgroud)

我正在尝试执行此代码,但控制台不断告诉我:

module 'pickle' has no attribute 'dump'
Run Code Online (Sandbox Code Playgroud)

我需要通过pip安装泡菜吗?我不确定这里发生了什么。

python pickle

5
推荐指数
2
解决办法
3216
查看次数

标签 统计

javascript ×1

pickle ×1

python ×1

twilio ×1