Plugins and child theme (my own) gets magically removed. How to avoid?
-
Hello,
I've been getting my feet wet with Nodebb for a few weeks now preparing to break away from another php forum.
I've been following all I can find in the creation of plugins and child themes. It seems to be rewarding with the exception of my plugins or themes being deleted from my node_modules folder... breaking everything and losing my development that I've painfully created as I learned the api bit by tiny bit.
In a nutshell... if I copy the theme quickstart and edit what's needed to make it unique, it shows up in the ACP and "just works". And it's confirmed working as my changes to new .tpl files are visible.
It seems if I install a plugin from the ACP that I want to try... the deletion of my custom folders happen. It's pretty much the same behavior for the plugin that I have to keep creating from scratch.
I read somewhere that the creation of a .git folder will protect against this. I have made this folder, but perhaps I did it in the wrong dir or I misunderstood something.
Any advise would be appreciated. I've been promising my users a amazing forum to replace their old home. So far I'm unable to produce it. -
First of all, you should be using
npm link
or at least manually symlinking your projects intonode_modules
so only the links get deleted if something happens.So this behavior is due to how new versions of npm work. NodeBB uses npm to install plugins. The short answer is to just say that your custom plugins and themes need to be added to package.json otherwise npm will remove it. npm might even remove it anyways. If you keep having issues, you might consider switching to yarn.
You can tell nodebb to use yarn by setting the
package_manager
field in config.json to "yarn" -
@ExeterDad try looking at this:
-
A big thanks to the both of you for your replies!
Now at least I have a better understanding of what's going on, and how to get around it. Unfortunately my plugin will never be published to install officially. It's useful to only us as it communicates with a custom plugin of a game server.
You all have a great day, and keep up the amazing work! -
Local paths are valid options for
package.json
too
https://docs.npmjs.com/files/package.json -