Custom deployment npm serve

Hello, new to this forum. I am Wouter from -ommited company- :slightly_smiling_face:

In preparation of our development project with you, I am setting up a custom deployment to get more in depth knowledge. I have extensively read the wiki to get started and with a lot of trial and error from learning to work with the tools, I finally got the custom project to run.

However, the npm serve command still fails.
npm ERR! 404 Not found - GET https://registry.npmjs.org/orutil - Not found
npm ERR! 404 “orutil@*” is not in this registry.

When I run ./gradlew modelWatch as suggested in another topic, it fails at:
‘openremote:ui:component:rest:npmBuild’

Process 'command ‘yarn’ ’ finished with non-zero exit value 1

I have ran the required yarn commands multiple times and tried different versions without success.

Does anyone have a suggestion what more to check?

Thanks in advance.
Wouter

Good afternoon, happy to have you in the OpenRemote forum!

Usually when you run that gradle command, you should be able to view a detailed error message outlining exactly what failed. I have had this problem before and it could happen for a variety of reasons. The error you sent means that the yarn command failed (non-zero exit value of 1).

Please send over that detailed error message, so that we can figure out what’s going wrong!

Hi panos, thank you for your swift response!

./gradlew modelWatch returns the following:

Task :openremote:ui:component:rest:npmBuild
src/restclient.ts(5,24): error TS2307: Cannot find module ‘@openremote/model’ or its corresponding type declarations.
src/restclient.ts(1203,19): error TS2307: Cannot find module ‘axios’ or its corresponding type declarations.
src/restclient.ts(1204,24): error TS2307: Cannot find module ‘axios’ or its corresponding type declarations.
src/restclient.ts(1206,16): error TS2664: Invalid module name in augmentation, module ‘axios’ cannot be found.
src/restclient.ts(1238,35): error TS7006: Parameter ‘axiosResponse’ implicitly has an ‘any’ type.
src/index.ts(1,90): error TS2307: Cannot find module ‘axios’ or its corresponding type declarations.
src/index.ts(3,16): error TS2307: Cannot find module ‘qs’ or its corresponding type declarations.
src/index.ts(21,55): error TS7006: Parameter ‘config’ implicitly has an ‘any’ type.
src/index.ts(22,40): error TS7006: Parameter ‘params’ implicitly has an ‘any’ type.

Task :openremote:ui:component:rest:npmBuild FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:openremote:ui:component:rest:npmBuild’.
    Process ‘command ‘yarn’’ finished with non-zero exit value 1

./gradlew clean installDist returns the following:

Task :ui:app:custom:npmClean FAILED
Usage Error: The nearest package directory (/home/wouter/custom-project-OR/ui/app/custom) doesn’t seem to be part of the project declared in /home/wouter/custom-project-OR.

  • If /home/wouter/custom-project-OR isn’t intended to be a project, remove any yarn.lock and/or package.json file there.
  • If /home/wouter/custom-project-OR is intended to be a project, it might be that you forgot to list ui/app/custom in its workspace configuration.
  • Finally, if /home/wouter/custom-project-OR is fine and you intend ui/app/custom to be treated as a completely separate project (not even a workspace), create an empty yarn.lock file in i
    t.

$ yarn run [–inspect] [–inspect-brk] [-T,–top-level] [-B,–binaries-only] [–require #0] …

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:ui:app:custom:npmClean’.
    Process ‘command ‘yarn’’ finished with non-zero exit value 1

Reading the error messages, it looks like the project’s home directory is not set correctly; check here for more information.

All settings on the page you mention are correct.
I am under the impression that the problem lies within the name of the root folder, because my github project is called custom-project-OR and is pulled as such for the name of the root folder, but the project structure shows a structure within folder custom-project. All newly generated folders by the build also get excluded from the project.
I have now renamed the root folder and will try again. Will take a while because indexing took 2 days last time :smile:

Hi Wouter,

Looks like an issue with the following command (which is automatically run by many gradle tasks):

yarn install

Can you please run this from your custom project directory and report back the output please (can also try replacing the yarn.lock with the one from the openremote submodule directory as these sometimes get out of sync and possibly we need to update the yarn.lock in the custom project.

Hi Rich,

yarn install did give an error before indeed.
However I have now recloned the repo while changing the name back to custom-project and everything runs fine now. Not sure if it is just the fresh clone that did the job or if there is a fixed reference somewhere to the main folder name?

Thanks for the help guys, on to the next steps :slight_smile:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.