-
Since I need to add some custom files in app/data, I need to include some other packages in my node app (package.json) that only lives in /app/code. But it is always overwritten after a restart so my question is how to persist the new packages in my package.json? What tricks are possible?
-
@devtron Is this a custom app? Or some app from the App Store ?
-
-
I guess this is related to https://forum.cloudron.io/topic/9129/how-to-install-npm-packages-in-your-app/3 .
mm, so far , we haven't found a good way to do this. You want to install custom node modules for your extension, correct ?
-
@devtron I don't know much about Directus extensions. But it looks like say https://github.com/dimitrov-adrian/directus-extension-searchsync is an extension ? Each extension has a package.json of it's own.
(If the above is correct...)
- You can then npm install in the extension's subdirectory
- Then, in
/app/data/env.sh
just addexport NODE_PATH=/app/data/extensions/myext/node_modules
and restart the app.
Would something like above work? NODE_PATH sets the search directory for node modules. You can even set multiple paths separated by colon.
-
-
Documented here - https://docs.cloudron.io/apps/directus/#custom-modules
-
-
-