mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-20 04:29:15 +00:00
Fixing remote auth optional depencies error (#1640)
Co-authored-by: Rajeh Taher <rajeh@reforward.dev>
This commit is contained in:
@@ -6,7 +6,9 @@ try {
|
|||||||
var unzipper = require('unzipper');
|
var unzipper = require('unzipper');
|
||||||
var archiver = require('archiver');
|
var archiver = require('archiver');
|
||||||
} catch {
|
} catch {
|
||||||
throw new Error('Optional Dependencies [fs-extra, unzipper, archiver] are required to use RemoteAuth. Make sure to run npm install correctly and remove the --no-optional flag');
|
fs = undefined;
|
||||||
|
unzipper = undefined;
|
||||||
|
archiver = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
@@ -23,6 +25,7 @@ const BaseAuthStrategy = require('./BaseAuthStrategy');
|
|||||||
*/
|
*/
|
||||||
class RemoteAuth extends BaseAuthStrategy {
|
class RemoteAuth extends BaseAuthStrategy {
|
||||||
constructor({ clientId, dataPath, store, backupSyncIntervalMs } = {}) {
|
constructor({ clientId, dataPath, store, backupSyncIntervalMs } = {}) {
|
||||||
|
if (!fs && !unzipper && !archiver) throw new Error('Optional Dependencies [fs-extra, unzipper, archiver] are required to use RemoteAuth. Make sure to run npm install correctly and remove the --no-optional flag');
|
||||||
super();
|
super();
|
||||||
|
|
||||||
const idRegex = /^[-_\w]+$/i;
|
const idRegex = /^[-_\w]+$/i;
|
||||||
@@ -198,4 +201,4 @@ class RemoteAuth extends BaseAuthStrategy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = RemoteAuth;
|
module.exports = RemoteAuth;
|
||||||
|
|||||||
Reference in New Issue
Block a user