nodejs ttn软件包-_.template不是函数

时间:2018-07-16 11:10:39

标签: node.js ubuntu-18.04

我的代码:

var ttn = require("ttn")  
var appID = "***"  
var accessKey = "ttn-account-********************"  
ttn.data(appID, accessKey).then(function (client) {  
    client.on("uplink", function (devID, payload) {  
        console.log("Received uplink from >>>", devID)  
        console.log("payload >>> ", payload);  
    })  
}).catch(function (error) {  
    console.error("Error >>>", error)   
    process.exit(1)  
})  

执行时,出现以下错误:

/home/ben/node_modules/ttn/node_modules/grpc/index.js:178
var log_template = _.template(
                 ^

TypeError: _.template is not a function
at Object.<anonymous> (/home/ben/node_modules/ttn/node_modules/grpc/index.js:178:22)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/ben/node_modules/ttn/dist/discovery/discovery.js:30:13)
at Module._compile (module.js:652:30)

任何人都可以帮助您理解和解决此问题吗?预先感谢。

0 个答案:

没有答案