Flowise icon indicating copy to clipboard operation
Flowise copied to clipboard

[bug]It doesn't work when I add " const fs = require('fs');" to my custom tool

Open musuiot opened this issue 9 months ago • 4 comments

It doesn't work when I add the following to my custom tool: const fs = require('fs'); const path = require('path'); why?

musuiot avatar May 13 '24 09:05 musuiot

Can't custom tools introduce packages about files and paths? So how to operate local files?

musuiot avatar May 13 '24 09:05 musuiot

its not allowed by default, because then it exposes huge risk for others to gain access to your file system. However, you can still import it via TOOL_FUNCTION_BUILTIN_DEP env variable - https://docs.flowiseai.com/configuration/environment-variables#built-in-and-external-dependencies

HenryHengZJ avatar May 13 '24 15:05 HenryHengZJ

Flowise support different environment variables to configure your instance. You can specify the following variables in the .env file inside packages/server folder I did not find the above folder, mine is a windows system "C:\Users\msrobot\AppData\Roaming\npm\node_modules\flowise\node_modules\flowise-ui.env" I only found this file, but adding the environment variable had no effect on the task.

musuiot avatar May 14 '24 04:05 musuiot

I did not install it with docker. Please help me point out the location of the .env file. I have been looking for it for a long time but could not find it. Thank you.

musuiot avatar May 14 '24 12:05 musuiot

@musuiot you have to create a new file .env file at C:\Users\msrobot\AppData\Roaming\npm\node_modules\flowise folder

HenryHengZJ avatar May 24 '24 00:05 HenryHengZJ