Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 将错误获取为str.charCodeAt不是一个函数_Node.js - Fatal编程技术网

Node.js 将错误获取为str.charCodeAt不是一个函数

Node.js 将错误获取为str.charCodeAt不是一个函数,node.js,Node.js,在使用npm的Msg91包时,我收到错误,因为str.charCodeAt不是isUnicodeString的函数 这是麦可德 module.exports = function(router, msg91){ router.get('/try', function(req, res){ res.render('secured/try', {user : req.user}); }); router.post('

在使用npm的Msg91包时,我收到错误,因为str.charCodeAt不是isUnicodeString的函数

这是麦可德

 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);
             });
          });

      };

帮助我解决这个问题。

我在Msg91 npm包中发现了这个问题,我创建了一个请求,让作者合并它

这是在
index.js


请继续关注合并

是否尝试调试该库?看看它为什么失败,它期望什么。如果您很难理解出现故障的原因,请向我们展示它出现故障的函数及其输入参数。告诉我需要在index.js中更改什么。转到第27行并更改:
message=validateMessage(validateMessage)
消息=验证消息(消息)但我的建议是将索引文件保存为项目中的一个模块,而不是通过npm使用它,因为每次重新安装节点模块或将其部署到服务器时,您的更新都会被覆盖。我已经做了一个更改,但仍然收到相同的错误更改文件后是否重新启动了服务器?