• Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
v3.5.2 Latest
Buy Hosting

Plugins and child theme (my own) gets magically removed. How to avoid?

Scheduled Pinned Locked Moved Technical Support
7 Posts 5 Posters 994 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    ExeterDad
    wrote on last edited by ExeterDad
    #1

    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. 🙂

    1 Reply Last reply
    0
  • PitaJP Offline
    PitaJP Offline
    PitaJ Global Moderator Plugin & Theme Dev
    wrote on last edited by
    #2

    First of all, you should be using npm link or at least manually symlinking your projects into node_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"

    1 Reply Last reply
    0
  • B Offline
    B Offline
    Brophy GNU/Linux Gamers
    wrote on last edited by
    #3

    @ExeterDad try looking at this:

    https://community.nodebb.org/post/67548

    1 Reply Last reply
    0
  • E Offline
    E Offline
    ExeterDad
    wrote on last edited by
    #4

    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!

    1 Reply Last reply
    0
  • julianJ Offline
    julianJ Offline
    julian GNU/Linux
    wrote on last edited by
    #5

    If you don't ever intend to publish, you can continue using npm link, or consider publishing to a private scoped npm package 👍

    1 Reply Last reply
    0
  • yariplusY Offline
    yariplusY Offline
    yariplus Community Rep
    wrote on last edited by
    #6

    Local paths are valid options for package.json too
    https://docs.npmjs.com/files/package.json

    1 Reply Last reply
    0
  • E Offline
    E Offline
    ExeterDad
    wrote on last edited by
    #7

    You guys are very helpful 🙂
    I've been in Open Source "stuff" for nearly two decades and have learned many things... but node.js and friends is completely uncharted waters for me.
    I will make this forum work for us. It's just too darn cool to overlook.

    1 Reply Last reply
    1

Copyright © 2023 NodeBB | Contributors
  • Login

  • Don't have an account? Register

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post
0
  • Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development