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


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
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
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Directus
  3. How to install npm packages in your app?

How to install npm packages in your app?

Scheduled Pinned Locked Moved Directus
5 Posts 2 Posters 914 Views 2 Watching
  • 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.
    • D Offline
      D Offline
      devtron
      wrote on last edited by devtron
      #1

      I've found out that it seems to be not possible to install node packages in /app/core and files can only persist in /app/data. in the data directory I have some predefined extensions ready (the app I am using is directus) and it would be awesome if I could use my custom js files during the app start. Unfortunately, I get an error (the reason should be what I already mentioned above)

      npm notice
      Apr 29 10:48:16 "/app/data/extensions/endpoints/firebase/index.js"
      Apr 29 10:48:16 "/app/data/extensions/hooks/firebase/index.js"
      Apr 29 10:48:16 "code": "MODULE_NOT_FOUND",
      Apr 29 10:48:16 "code": "MODULE_NOT_FOUND",
      Apr 29 10:48:16 "message": "Cannot find module 'firebase-admin/app'\nRequire stack:\n- /app/data/extensions/hooks/firebase/index.js",
      Apr 29 10:48:16 "message": "Cannot find module 'jsonwebtoken'\nRequire stack:\n- /app/data/extensions/endpoints/firebase/index.js",
      Apr 29 10:48:16 "requireStack": [
      Apr 29 10:48:16 "requireStack": [
      Apr 29 10:48:16 "stack":
      Apr 29 10:48:16 "stack":
      Apr 29 10:48:16 "type": "Error",
      Apr 29 10:48:16 "type": "Error",
      Apr 29 10:48:16 - /app/data/extensions/endpoints/firebase/index.js
      Apr 29 10:48:16 - /app/data/extensions/endpoints/firebase/index.js
      Apr 29 10:48:16 - /app/data/extensions/hooks/firebase/index.js
      Apr 29 10:48:16 - /app/data/extensions/hooks/firebase/index.js
      Apr 29 10:48:16 Error: Cannot find module 'firebase-admin/app'
      Apr 29 10:48:16 Error: Cannot find module 'jsonwebtoken'
      Apr 29 10:48:16 Require stack:
      Apr 29 10:48:16 Require stack:
      Apr 29 10:48:16 Require stack:
      Apr 29 10:48:16 Require stack:
      Apr 29 10:48:16 [08:48:16.441] WARN: Cannot find module 'firebase-admin/app'
      Apr 29 10:48:16 [08:48:16.441] WARN: Couldn't register hook "firebase"
      Apr 29 10:48:16 [08:48:16.443] WARN: Cannot find module 'jsonwebtoken'
      Apr 29 10:48:16 [08:48:16.443] WARN: Couldn't register endpoint "firebase"
      Apr 29 10:48:16 [08:48:16.572] INFO: Loaded extensions: firebase, firebase
      Apr 29 10:48:16 [08:48:16.765] WARN: Missing driver definition for "firebase" auth provider.
      Apr 29 10:48:16 [08:48:16.765] WARN: Missing driver definition for "twitter" auth provider.
      Apr 29 10:48:16 [08:48:16.836] INFO: Server started at http://0.0.0.0:8055
      Apr 29 10:48:16 ]
      

      How can I make it running?

      1 Reply Last reply
      0
      • robiR Offline
        robiR Offline
        robi
        wrote on last edited by
        #2

        Yes, that is a feature of Cloudron where /app/code is read-only.

        /app/data is the right place for custom user configs, however you need to make sure to modify the app config file or environment variables to make sure it knows where to find your custom changes.

        Check the Cloudron docs to see how that is done.

        Conscious tech

        D 1 Reply Last reply
        0
        • girishG girish moved this topic from Support on
        • robiR robi

          Yes, that is a feature of Cloudron where /app/code is read-only.

          /app/data is the right place for custom user configs, however you need to make sure to modify the app config file or environment variables to make sure it knows where to find your custom changes.

          Check the Cloudron docs to see how that is done.

          D Offline
          D Offline
          devtron
          wrote on last edited by
          #3

          @robi

          Where can I find it in the docs because I did not find it yet.

          1 Reply Last reply
          0
          • D Offline
            D Offline
            devtron
            wrote on last edited by
            #4

            Need further assistance in this case..

            1 Reply Last reply
            0
            • D Offline
              D Offline
              devtron
              wrote on last edited by
              #5

              I've found this:
              https://docs.cloudron.io/apps/directus/

              Example Link is not working:
              https://github.com/directus/directus/blob/main/api/example.env

              1 Reply Last reply
              0
              • girishG girish referenced this topic on
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Bookmarks
                • Search