Problem/Motivation

my hosting provider offers node.js in some fixed setup.
installation of packages is only availabe from Ui/PLESK. npm can't be executed from command line.
or i need to find a way. packages must be in a certain directory to work.

is there a way to install the things manually (i know that ma ynot be comftable)

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

lblabr created an issue. See original summary.

vzsigmond’s picture

Node.js is only needed at build time - never to serve the site (the optional sdx_ssr submodule is the exception: it needs a persistent Node process, which shared hosting won't give you - skip it, components render client-side without it).

Right now a build does have to happen *somewhere*, but it doesn't have to be on your hosting. The workflow for your situation:

1. Set up the site locally (any machine with PHP + Node), then:

drush cset sdx.settings build_output_mode distributed
drush sdx:resolve
drush sdx:build

2. In distributed mode the compiled artifacts land inside the owning module/theme (e.g. my_theme/dist/, sdx_react/dist/) instead of the files directory, so you can commit them to git or upload them with your codebase like any other file. The server needs no npm, no node, no build step - the runtime picks up the in-extension dist/ automatically.

About installing packages manually into "the right directory": the npm workspace lives in the private files area (private://sdx/), but it is build infrastructure only - if you build off-server as above, it never needs to exist on your hosting, so I wouldn't fight PLESK's fixed Node setup at all. Don't run drush sdx:resolve / sdx:build on the server; a missing workspace there doesn't affect serving.

@todo: docs/guide/build-pipeline.md currently says contrib SDX modules ship pre-built artifacts in the drupal.org packages - that's the design goal but isn't true of the current releases, so the local-build step above is required even if you only use stock components. Tracking that separately; this issue is a good push to make the pre-built distribution real, which would make shared hosting a zero-build install.

lblabr’s picture

thanks a lot, i will try that!

but, the shared hosting supports ssh and i got node + npm working on command line
it support running nodejs applications.

so it might run directly on the server (maybe) need to check

lblabr’s picture

tried you way on the shared hosting that supports a lot ...

still getting these db errors...

bash-5.1$ php -d memory_limit=1G ./vendor/bin/drush.php sdx:resolve

In ExceptionHandler.php line 89:

  SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: INSERT INT
  O "a_cache_bootstrap" ("cid", "expire", "created", "tags", "checksum", "dat
  a", "serialized") VALUES (:db_insert_placeholder_0, :db_insert_placeholder_
  1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placehold
  er_4, :db_insert_placeholder_5, :db_insert_placeholder_6) ON DUPLICATE KEY
  UPDATE "expire" = VALUES("expire"), "created" = VALUES("created"), "tags" =
   VALUES("tags"), "checksum" = VALUES("checksum"), "data" = VALUES("data"),
  "serialized" = VALUES("serialized"); Array
  (
      [:db_insert_placeholder_0] => hook_data
      [:db_insert_placeholder_1] => -1
      [:db_insert_placeholder_2] => 1786310322.597
      [:db_insert_placeholder_3] =>
      [:db_insert_placeholder_4] => 0
      [:db_insert_placeholder_5] => a:0:{}
      [:db_insert_placeholder_6] => 1
  )


In PdoTrait.php line 109:

  SQLSTATE[HY000]: General error: 2006 MySQL server has gone away


bash-5.1$
vzsigmond’s picture

Could you give it another try with the latest version and let me know if the issue still shows up? (alpha12 just dropped)

lblabr’s picture

looks good! we can close this issue. i need to make the next step ;)

lblabr’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.