Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    How to install JWT in Directus - getting error

    Directus
    5
    12
    450
    Loading More Posts
    • 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.
    • Jeyakumarrathnaselvi
      Jeyakumarrathnaselvi last edited by

      I am trying to embed metabase dashboard to directus

      need to install JWT but below command throwing me an error

      $ npm install jsonwebtoken

      1d5a163c-66b7-443c-a3b0-bf5c95710253-image.png

      can someone help how to install it through a terminal

      BrutalBirdie 1 Reply Last reply Reply Quote 0
      • BrutalBirdie
        BrutalBirdie Staff @Jeyakumarrathnaselvi last edited by

        @Jeyakumarrathnaselvi if its not packaged into the app directly you can't do it.
        Since the core of the app is read-only.

        Would it not work to use the metabase app directly?

        I also found your discussion here:

        https://github.com/directus/directus/discussions/15615


        One option for testing, although not persistent.
        Start the app in recovery mode and install all you need.
        Then start the app via /app/pkg/start.sh

        https://git.cloudron.io/cloudron/directus-app/-/blob/master/Dockerfile#L13

        Like my work? Consider donating a beer 🍻 Cheers!

        BrutalBirdie 1 Reply Last reply Reply Quote 0
        • BrutalBirdie
          BrutalBirdie Staff @BrutalBirdie last edited by

          @BrutalBirdie oh and if you find a way to get it working, document they way you made it working here so some appdev may add your changed persistent 😉

          Like my work? Consider donating a beer 🍻 Cheers!

          1 Reply Last reply Reply Quote 0
          • Jeyakumarrathnaselvi
            Jeyakumarrathnaselvi last edited by

            @BrutalBirdie I tried but it is not allowing me to install it

            girish 1 Reply Last reply Reply Quote 0
            • Moved from Support by  girish girish 
            • girish
              girish Staff @Jeyakumarrathnaselvi last edited by

              @Jeyakumarrathnaselvi Are you having to install new npm modules because you are developing some directus plugin/extension?

              Jeyakumarrathnaselvi 1 Reply Last reply Reply Quote 0
              • Jeyakumarrathnaselvi
                Jeyakumarrathnaselvi @girish last edited by

                @girish Yes but not able install. i tried installing in recovery but after installing. app is crashing

                i need to install jsonwebtoken

                Jeyakumarrathnaselvi 1 Reply Last reply Reply Quote 0
                • Jeyakumarrathnaselvi
                  Jeyakumarrathnaselvi @Jeyakumarrathnaselvi last edited by

                  @Jeyakumarrathnaselvi Can someone help

                  girish 1 Reply Last reply Reply Quote 0
                  • girish
                    girish Staff @Jeyakumarrathnaselvi last edited by

                    @Jeyakumarrathnaselvi I am not sure how this can be solved in Cloudron context. Essentially, the situation here is that we want to add extra code to an app which brings it's own dependencies/libraries.

                    Where/how does a Directus extension load extra node_modules from? Can it be under the extensions directory or does it have to be installed system wide? If it's latter, I am afraid we are out of luck and this is not possible with Cloudron.

                    ruihildt 1 Reply Last reply Reply Quote 0
                    • ruihildt
                      ruihildt @girish last edited by

                      @girish I was looking into adding extensions for Directus, more specifically this one: https://github.com/dimitrov-adrian/directus-extension-masked-interface

                      Do you think it will work or does using npm install means it's always a system-wide installation?

                      girish M 2 Replies Last reply Reply Quote 0
                      • girish
                        girish Staff @ruihildt last edited by

                        @ruihildt Installing extra npm modules doesn't work. I am not sure how we can solve this since the filesystem is readonly. I looked into upstream Directus docker file for some inspiration but it looks like it's abandoned.

                        1 Reply Last reply Reply Quote 0
                        • M
                          msbt App Dev @ruihildt last edited by

                          @ruihildt I've installed a few extensions from that repo and what I usually do is clone it locally, run npm install and npm run build, this will create a dist folder with the index.js-files that you can upload into the correlating extensions-folder via the file manager. Not sure if this applies to this very extension, because the description is missing, but it worked for various others. I just tried it and it installs fine, but I haven't uploaded it (and don't forget to restart Directus, it will tell you which extensions were loaded)

                          ruihildt 1 Reply Last reply Reply Quote 2
                          • ruihildt
                            ruihildt @msbt last edited by

                            @girish Maybe you could add those steps to the help section?

                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post
                            Powered by NodeBB