Install from CLI with custom plugin-list

Technical Support
  • Hi Community,
    this piece of code used to work in a custom setup-script:

        node app.js \
            --setup "{\"admin:username\":\"${ADMIN_USERNAME}\",\"admin:password\":\"${ADMIN_PASSWORD}\",\"admin:password:confirm\":\"${ADMIN_PASSWORD}\",\"admin:email\":\"${ADMIN_EMAIL}\"}" \
            --defaultPlugins "[\"nodebb-plugin-custom-homepage\", \"nodebb-plugin-custom-pages\", \"nodebb-plugin-dbsearch\", \"nodebb-plugin-emoji\", \"nodebb-plugin-emoji-android\", \"nodebb-plugin-emoji-extended\", \"nodebb-plugin-emoji-one\", \"nodebb-plugin-markdown\", \"nodebb-plugin-mentions\", \"nodebb-plugin-ns-embed\", \"nodebb-plugin-soundpack-default\", \"nodebb-plugin-spam-be-gone\", \"nodebb-rewards-essentials\", \"nodebb-theme-vanilla\", \"nodebb-widget-essentials\"${modulesToActivate}]" \
             || (echo "Unable to install nodebb" && exit 1)

    modulesToActivate has a string continuing the array of plugins.

    This seems so have changed. It also seem to delete symlinks created in the node_modules folder.

    Did anything change?
    Or what is the currently recommended way to install from CLI?

  • @sebastian-marinescu you should be able to do this with ./nodebb setup. You just do the following:

    ./nodebb setup [config json] --defaultPlugins="[etc etc]"

    As for the npm thing, it's a bug in npm@5, you can try using an older npm version to avoid it.

  • @pitaj Thanks for your answer! The npm@5-symlink-deletion was my main problem, so my command is working again. I would love to see it in the Documentations for future look-ups.

    I've anyhow tried using your suggested command with my params ./nodebb setup --params, but it's not working:

    • error: unknown option '--setup' - on the first try, then I deleted the setup param
    • error: unknown option '--defaultPlugins' - also unknown

    I'm on the v1.7.5 branch.

  • @sebastian-marinescu alternatively you could set defaultPlugins as an environment variable, then run ./nodebb setup [config json]. I'll re-add an actual option for passing in a set of default plugins.

Suggested Topics