Develop docker-compse service locally - package.json: engines.node must be specified

I have a multi-container app with a docker-compose.yml in the root directory.
Building via balena cloud works fine (git push balena).

What does not work is pushing to a local device in development mode.

$ balena push 192.168.178.94
[Info]    Starting build on device 192.168.178.94
[Info]    Creating default composition with source: .
package.json: engines.node must be specified

Hello, the error you report seems to indicate that you need to specify the engines keyword in your package.json (have a look at https://docs.npmjs.com/files/package.json#engines) I am not sure why that is required for local mode though, I will ask the team and get back to you on this but in the meantime I would suggest trying to add that and seeing if it unblocks you.

Could you also provide us with some info about what version of the OS, Supervisor and balena-cli you are currently using? Thank you

Actually, there is no package.json.
Rather, there is a docker-compose.yml.

Host OS Version
balenaOS 2.46.1+rev3

Supervisor Version
10.6.27

balena cli version
11.19.1

Thank you. Just one more thing: could you also try running the push with DEBUG=1 (e.g. DEBUG=1 balena push ...) and let us know if there are any other logs appearing?

Actually, there is no package.json .
Rather, there is a docker-compose.yml .

Nonetheless, for some reason the CLI is failing to find or to parse the docker-compose.yml file in the “current working directory” (current folder). When this happens, the CLI looks for a Dockerfile or a package.json file as alternatives. Suggestions:

Could any of the above be the case?

1 Like

Indeed, the source directory was the issue.

I double checked, and I was running

yarn --cwd build/balena-cli balena push 192.168.178.57

Adding --source $PWD fixes the problem.

Thank you!