Custom deployment: npm error Missing script: "serve"

Dears,
pls advise, i have proceeded through steps from here :

  1. Prepare your environment - done :heavy_check_mark:
  1. Clone your repository from the custom-project template. done :heavy_check_mark:

  2. Set up your IDE. Note that Application run configurations are already prepared when using this template.
    Use docker-compose -f profile\dev-testing.yml up --build -d and run the ‘Custom Deployment’ configuration. done :heavy_check_mark:

You should have two containers running in Docker done :heavy_check_mark:
,and the manager through your IDE.

  1. Run the modelWatch gradle task to build the typescript model ./gradlew modelWatch done :heavy_check_mark:

  2. Next we serve the Manager UI from the /openremote/ui/app/manager directory with npm run serve -- --env config=..\..\..\..\deployment\manager\app.
    this where i stuck (i am using IntelliJ Community Edition on Windows 10)

PS C:\Users..\Desktop\IOT\custom-project\ui\app\manager> npm run serve – --env config=…......\deployment\manager\app
npm error Missing script: “serve”
npm error
npm error To see a list of scripts, run:
npm error npm run
npm error A complete log of this run can be found in: C:\Users..\AppData\Local\npm-cache_logs\2025-02-23T08_53_31_910Z-debug-0.log

What OpenRemote version are you using in the custom project?

This fix (available in OR 1.2.2 or newer) may help:

You can update the OpenRemote version of your custom project as described here:

Hi there,
i am using the latest version just cloned from repo
maybe someone can recommend step-by-step actions (more detailed than in Docs) for newbies like me

In that ui/app/manager directory:

  • do you have a package.json file ?
  • what does the scripts section in there contain ?

There is no package.json file. It is not mentioned in docs

please advise what shall be inside of the folder and if possible pls share the package.json file

The documentation is a bit outdated there
running npm run serve relates to serving the manager UI that is part of the main repository.
There is no populated UI project in the custom project by default, so that won’t work.

If your goal is to run a custom project,
then from the custom project main dir:

  • ./gradlew clean installdist

  • build the custom deployment container:
    docker build -t openremote/custom-deployment:latest ./deployment/build/

  • edit the docker-compose in the main folder of the custom project: delete all x-logging/awslogs lines

  • run this docker compose.

  • browse to localhost

Is there a reason you need to run a custom Manager UI web development server?

Because, if you run the Manager in your IDE using the run configurations,
the default UI is already available by default at localhost:8080/manager/

Or are we indeed talking about a custom app here?

Hi,

I am also trying to run a ‘custom’ project, as this seemed like the first step in getting a bare-bones setup that I can then work off of. I have been having difficulties getting anything to work so far…
The idea is that I would have OpenRemote running on a linux server (CLI only) and I want to then be able to access the web page from other machines.
Is there a more simple step by step for this than what is in the current documentation, as you mention it is outdated.

I was able to easily run the ‘quick start’ setup using Docker Desktop, however I want to get this to run on the server and let me access the page on other computers.

Any input will be appreciated!

this worked for me, thanks a lot!

Just in case if anyone will be doing the same, it worked for me (experts, please add if something is wrong in the flow below):

  1. Prepare your environment
  2. Clone your repository from the custom-project template.
  3. from the custom-project dir:
    ./gradlew clean installdis
  4. then needed to build the custom deployment container:
    docker build -t openremote/custom-deployment:latest ./deployment/build/
  5. edit the docker-compose.yml in the custom-project dir:
    remove:
    x-logging: &awslogs
    logging:
    driver: awslogs
    options:
    awslogs-region: ${AWS_REGION:-eu-west-1}
    awslogs-group: ${OR_HOSTNAME}
    awslogs-create-group: 'true'
    tag: "{{.Name}}/{{.ID}}"

remove in each service (in proxy, postgresql, keycloak, manager):
<<: *awslogs

change:

deployment:
image: openremote/deployment:${DEPLOYMENT_VERSION?DEPLOYMENT_VERSION must be set}
volumes:
- deployment-data:/deployment

to this:

deployment:
image: openremote/custom-deployment:${DEPLOYMENT_VERSION?DEPLOYMENT_VERSION must be set}
volumes:
- deployment-data:/deployment

  1. add .env file into custom-project main dir with following content:
    DEPLOYMENT_VERSION=latest
    OR_ADMIN_PASSWORD=secret
    OR_HOSTNAME=localhost

  2. then run:
    docker compose up -d

  3. browse to https://localhost/

1 Like

Good to hear that worked :slight_smile:

With the introduction of versioning, the team has changed the way custom projects work recently.
That’s why some of the documentation related to custom projects is now outdated, in this case the page user-guide/deploying/custom-deployment. I will see if I can find the time to make a PR to update this part of the documentation :+1:

Beat me to it! :smiley: Thanks to @Berg as this way also worked for me.

Just to add @RRR , to access the webpage from an external machine, I also made changes to some of the ports settings on the docker-compose.yml of the custom project:

manager:
    image: openremote/manager:${MANAGER_VERSION:-latest}
    restart: always
    depends_on:
      keycloak:
        condition: service_healthy
    ports:
      - "8080:8080"  # Manager API
      - "8443:8443"  # HTTPS for Manager
      - "9000:9000"  # Manager UI


 proxy:
    image: openremote/proxy:${PROXY_VERSION:-latest}
    restart: always
    depends_on:
      manager:
        condition: service_healthy
    ports:
      - "80:80"
      - "443:443"
      - "8883:8883"

Also I changed this in the manager service environments:

OR_HOSTNAME: "<your-IP>"  # Set server's IP

Then to access the page I simply put the IP address into the URL bar of my browser and it should send you to the page over HTTPS.

Someone might want to correct this as I’m not entirely sure it needs to be done this specific way, but that is what I did and it worked from an external machine. :slight_smile: