2015-12-21 20 views
0

在使用来自NPM Msg91包,我得到误差str.charCodeAt是不是isUnicodeString得到错误的str.charCodeAt不是一个函数

的功能,这是mycode的

module.exports = function(router, msg91){ 
     router.get('/try', function(req, res){ 
      res.render('secured/try', {user : req.user}); 
      }); 

     router.post('/try', function(req, res){ 
      var message = 'Hapserve testing message from Developer'; 
      var mobileNo = parseInt(req.body.phone_no); 
      console.log(mobileNo); 
      msg91.send(mobileNo, message, function(err, response){ 
       if(err) 
       throw err; 
       console.log(response); 
      }); 
      }); 

     }; 

帮我理清这个问题..

+0

试图调试该库?看看它为什么会失败,它期望的是什么。如果您很难理解哪里出现故障,请向我们展示它失败的功能以及它获取的输入参数。 – AlexD

回答

0

我发现在Msg91 NPM包的问题,​​我创建了一个拉请求笔者将其合并

这里是拉入请求W¯¯第i个在index.js

https://github.com/hirenrojasara/Msg91/pull/2

请继续关注合并在第27行错误

+0

告诉我我需要在index.js中更改 – Nodemon

+0

转到第27行并更改: 'message = validateMessage(validateMessage);'message = validateMessage(message);' – udidu

+0

但我的建议是保存索引文件作为你项目中的一个模块,而不是通过npm使用它,因为每次你重新安装节点模块或者将它部署到你的服务器时,你的更新都会被覆盖。 – udidu

相关问题