0

Is it possible to implement LDAP search through angular application?

I wanted to implement LDAP in my Angular application but couldn't find any helpful resources.

I was tried with LDAPjs (https://www.npmjs.com/package/ldapjs) but it was producing following runtime error:

ERROR in ./node_modules/bunyan/lib/bunyan.js
Module not found: Error: Can't resolve 'fs' in 'D:\ldap\node_modules\bunyan\lib'
ERROR in ./node_modules/mkdirp/index.js
Module not found: Error: Can't resolve 'fs' in 'D:\ldap\node_modules\mkdirp'
ERROR in ./node_modules/mv/index.js
Module not found: Error: Can't resolve 'fs' in 'D:\ldap\node_modules\mv'
ERROR in ./node_modules/mv/node_modules/glob/sync.js
Module not found: Error: Can't resolve 'fs' in 'D:\ldap\node_modules\mv\node_modules\glob'
ERROR in ./node_modules/mv/node_modules/glob/glob.js
Module not found: Error: Can't resolve 'fs' in 'D:\ldap\node_modules\mv\node_modules\glob'

Could anyone have worked on it or do you have any useful resources for reference?

Thanks

Arslanbekov Denis
  • 1,674
  • 12
  • 26
  • mm it looks like you're tryng to import fs .. something like in your code .. import {fs} from '...'; .. it looks like an error import or you're tryng to use a npm package for back end – federico scamuzzi Oct 16 '18 at 14:02
  • Your node paths are not correct, so npm can't find the path to the native fs module. I've been using activedirectory, which is based on ldapjs, without any issues and haven't had bunyan issues yet. So have a look at some examples to install node and change node paths, since you'll have to reconfigure your NPM to point to the correct directory. – Shilly Oct 16 '18 at 14:12
  • We can't use fs anymore in Angular v6 Right ?https://stackoverflow.com/questions/50202948/update-to-angular-v6-module-not-found-error-cant-resolve-fs Plz refer David Dal Busco cmts – Stephen Raj Oct 16 '18 at 14:15
  • @Shilly do you have any reference ? – Stephen Raj Oct 16 '18 at 14:17
  • If we can't use FS anymore in angular, that's a huge problem. Have you tried any of the solutions in the angular discussions? Like using the tsconfig file for it? And no, I don't have references. Your errors look like basic path not found errors, so I was thinking that direction. I didn't know that angular 6 has these kind of issues since I don't use angular 6. I also thought you were using angular 2 instead of 6 due to the title. – Shilly Oct 16 '18 at 14:24
  • @Shilly Can you share the ldapjs npm package name? Thanks – Stephen Raj Oct 16 '18 at 14:25
  • 1
    The one I use for activedirectory? https://www.npmjs.com/package/activedirectory But it will have the same issues if this is an angular 6 issue. If it's a path issue, you can fix that. But if this is an angular 6 issue, switching packages will not fix anything and the one I linked will have the same issues since the module i use is built on top of the one you use. – Shilly Oct 16 '18 at 14:27

0 Answers0