diff --git a/src/plugin.ts b/src/plugin.ts index 1e966bcb..aac85dae 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -123,9 +123,9 @@ export class Plugin implements IPlugin { if (!this.commandsDir) return [] let globby: typeof Globby try { - globby = require('globby') - } catch { - this._debug('not loading commands, globby not found') + globby = require(`${this.root}/node_modules/globby`) + } catch (err) { + this.warn(err, 'not loading commands, globby not found') return [] } this._debug(`loading IDs from ${this.commandsDir}`) diff --git a/src/ts_node.ts b/src/ts_node.ts index 8873bb47..f82cf798 100644 --- a/src/ts_node.ts +++ b/src/ts_node.ts @@ -24,9 +24,9 @@ function registerTSNode(root: string) { const tsconfig = loadTSConfig(root) if (!tsconfig) return debug('registering ts-node at', root) - const tsNode: typeof TSNode = require('ts-node') + const tsNode: typeof TSNode = require(`${root}/node_modules/ts-node`) tsconfigs[root] = tsconfig - typeRoots.push(`${root}/../node_modules/@types`) + typeRoots.push(`${root}/node_modules/@types`) if (tsconfig.compilerOptions.rootDirs) { rootDirs.push(...tsconfig.compilerOptions.rootDirs.map(r => path.join(root, r))) } else {