Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
musuiot opened this issue May 13, 2024 · 5 comments
Labels
question Further information is requested

Comments

@musuiot
Copy link

musuiot commented May 13, 2024

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

@musuiot musuiot changed the title It doesn't work when I add " const fs = require('fs');" to my custom tool [bug]It doesn't work when I add " const fs = require('fs');" to my custom tool May 13, 2024
@musuiot
Copy link
Author

musuiot commented May 13, 2024

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

@HenryHengZJ
Copy link
Contributor

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 HenryHengZJ added the question Further information is requested label May 13, 2024
@musuiot
Copy link
Author

musuiot commented May 14, 2024

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
Copy link
Author

musuiot commented May 14, 2024

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.

@HenryHengZJ
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants