jsumners / node-activedirectory

ActiveDirectory is an Node.js ldapjs client for authN (authentication) and authZ (authorization) for Microsoft Active Directory with range retrieval support for large Active Directory installations. Originally forked from gheeres/node-activedirectory.
MIT License
52 stars 43 forks source link

cannot resolve dependencies errors when building webpack #7

Closed donnrriz closed 7 years ago

donnrriz commented 7 years ago

I have installed activedirectory2 Followed up a basic example: var ActiveDirectory = require('activedirectory2'); var config = { url: '...', baseDN: '....', username: '...', password: '....' } var ad = new ActiveDirectory(config);

When I build my project using webpack2 I get the following errors:

Can't resolve 'net' in 'C:...\node_modules\ldapjs\lib' Can't resolve 'tls' in 'C:...\node_modules\ldapjs\lib' Can't resolve 'net' in 'C:...\node_modules\ldapjs\lib\client' Can't resolve 'tls' in 'C:...\node_modules\ldapjs\lib\client' Can't resolve 'fs' in 'C:...\node_modules\bunyan\lib' Can't resolve 'fs' in 'C:....\node_modules\mv Can't resolve 'fs' in 'C:...\node_modules\ncp\lib Can't resolve 'fs' in 'C:...\node_modules\mv\node_modules\rimraf Can't resolve 'fs' in 'C:...\node_modules\mkdirp Can't resolve 'fs' in 'C:...\node_modules\mv\node_modules\glob

If anyone has any ideas about resolving this I be very graeful for any comments

jsumners commented 7 years ago

Sorry, I am unable to support webpack. In fact, I don't think it would even be possible.

donnrriz commented 7 years ago

For anyone else getting these errors. Add
node: { console: false, fs: 'empty', net: 'empty', tls: 'empty' },

Into you webpack.config. The modules 'fs' , 'tls' are node modules and should be ignored in the broswer - the above config addition will allow that. Thanks for the library jsumners !

donnrriz commented 7 years ago

Oh yes also see https://github.com/trentm/node-bunyan/issues/392 to deal with other issues, regarding optional bunyan files