Is anything required to `npm install` for new packages? (Node/Pi)


I can’t seem to find an answer; is there any command or action to help new npm packages get installed, when they get deployed via balena push (both local + prod).

(node, on a pi with balenaOS)

After adding new package to package.json, I then push locally.

In the device log, I get the error: Cannot find module "blah".

Question is: Is there any way to ensure that npm package gets installed?

Perhaps it needs to use docker or something? I’m still new to docker.


Hi @jr67, first of all welcome to the balena community :smiley:

Have you seen / followed any of our getting started guides?
The following one covers how to push a sample node.js application to Raspberry Pi3:

Here you can see the dockerfile used in that sample project:

As you can see, in the dockerfile the package.json files are copied and then npm install is run as part of the release. I guess that you might be missing these steps in your own application. So I suggest you to start looking there first.

Let us know how it goes. If you keep experiencing this issue, it’d help if you could share a minimal version of your dockerfile to reproduce this error.

Hi @jr67, Did you have any success with this or do you still require some support?

Hi, that’s great thanks!