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

Use js-controller v6 methods to manage node modules #1554

Open
foxriver76 opened this issue Apr 23, 2024 · 7 comments
Open

Use js-controller v6 methods to manage node modules #1554

foxriver76 opened this issue Apr 23, 2024 · 7 comments

Comments

@foxriver76
Copy link
Contributor

foxriver76 commented Apr 23, 2024

Is your feature request related to a problem? Please describe.
Currently when installing user defined node modules, npm will clean them at every operation, leading to the module not being available until a restart of javascript adapter.

Describe the solution you'd like
js-controller v6 introduces new methods with ioBroker/ioBroker.js-controller#2650 to install and require node modules without running into this issue

Describe alternatives you've considered
None

Additional context
Code needs to check if methods available if yes use this method else stick to old behavior

Only for implementing developer: To test the feature locally with the js-controller v6, simply install iobroker.js-controller@dev

@klein0r
Copy link
Collaborator

klein0r commented May 2, 2024

Only for implementing developer: To test the feature locally with the js-controller v6, simply install iobroker.js-controller@dev

@dev is 5.0.20-alpha.0-20240502-e03492751 instead of 6.x ?

@foxriver76
Copy link
Contributor Author

Yes, at development time there is no v6

@klein0r
Copy link
Collaborator

klein0r commented May 2, 2024

@foxriver76 Please review 3bc5b19

@foxriver76
Copy link
Contributor Author

foxriver76 commented May 3, 2024

Thanks a lot, LGTM in general 👍

I think this should be awaited too 3bc5b19#diff-58417e0f781b6656949d37258c8b9052ed266e2eb7a5163cad7b0863e6b2916aR1813

Do you know if there is also code somewhere to remove the node modules?

@klein0r
Copy link
Collaborator

klein0r commented May 3, 2024

Do you know if there is also code somewhere to remove the node modules?

At the moment: no.

Can you provide some function to get all installed packages for the current namespace? In that case I could remove all packages which are not in the packages list of the instance.

@foxriver76
Copy link
Contributor Author

foxriver76 commented May 3, 2024

Yes, so we need something like a adapter.listInstalledNodeModules() returning a string array with the package names. I can implement no problem.

@foxriver76
Copy link
Contributor Author

Please have a look if this will be suitable for you: ioBroker/ioBroker.js-controller#2723

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants