我正在尝试使用 npm 模块 activedirectory在 Meteor 应用程序中,当我尝试按照文档创建新的事件目录时,出现错误。我正在从另一个 Meteor 项目中的工作示例进行复制,因此我知道配置值是正确的,并且我看不到我的项目和工作项目之间有任何其他有意义的差异。
我已经安装了模块activedirectory,它在node_modules目录中可见。
const activedirectory = require('activedirectory');
function getUserDataFromAD(username) {
console.log(`typeof activedirectory ${typeof activedirectory}`);
var AD = new activedirectory({
url:'ldap://validurl',
baseDN:'validDN',
username:validUN,
password:validPW,
});
}
在控制台中我看到:
typeof activedirectory object
I20180720-12:33:09.073(1)? Exception while invoking method 'login' TypeError: activedirectory is not a constructor
有什么想法吗?这让我很困惑!
最佳答案
原来是我没有给这个项目安装activedirectory包。这是一个愚蠢的疏忽,但我希望这些错误会更有帮助。
关于node.js - 使用 npm 模块 activedirectory 时出错 : "TypeError: activedirectory is not a constructor",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51441689/