whisper-node icon indicating copy to clipboard operation
whisper-node copied to clipboard

whisper-node sets rootDir to node_modules package when importing it

Open YozoraWolf opened this issue 1 year ago • 1 comments

I have made the same issue in the ts version one . But thought I might as well leave it here for future reference.

Basically same issue as listed in the issue linked above.

Without loading the file with import whisper from 'whisper-node':

[INFO] Root directory: /home/wolf/develop/nodejs/okuuai/node_modules/whisper-node/lib/whisper.cpp // using process.cwd()
[INFO] Root directory path: /home/wolf/develop/nodejs/okuuai/src // using path

Without loading it:

[INFO] Root directory: /home/wolf/develop/nodejs/okuuai
[INFO] Root directory path: /home/wolf/develop/nodejs/okuuai/src

It would be great to have some help on this, please.

YozoraWolf avatar May 12 '24 03:05 YozoraWolf

Currently having this issue as well. As a short-term workaround I am changing the directory back to my expected root directory before setting anything else up.

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

process.chdir(__dirname);
dotenv.config();

marcJV avatar May 21 '24 21:05 marcJV