Adjusted package.json of node-red-contrib-spotify locally, how to 'reload' it into Node Red?

Sorry this is probably a silly question.

I saw that node-red-contrib-spotify does not have all Spotify API functionalities.
Essentially node-red-contrib-spotify is a wrapper around spotify-web-api-node which is missing these functionalities.
I see that this fork has the missing functionalities.

So I opened \192.168.1.5\addon_configs\a0d7b954_nodered\node_modules\node-red-contrib-spotify\package.json and adjusted the dependency to point to the fork:
"dependencies": {
"spotify-web-api-node": "github:sergencug/spotify-web-api-node"
}

But how do I get Node Red to reload the package.json file? I tried rebooting the node red addon in Home Assistant, but it didn't work.

Im not sure this will work (I'm not a pro at the NPM internals) - or HA, not many here use HA.

But go to your .node-red directory (or whatever that is for HA - again, not many users of HA here)

and issue npm install at the terminal - of the node-red environment
finally restart Node-RED

I'm not sure that will work, but could be wrong - have never done these type of patches.

Thanks for the suggestion!
So when I do the following:
cd /config/node-red/
npm install

I get an error:
bash: npm: command not found

And searching online I don't really find others who are trying to then install npm (and I wouldn't know how to do it), so I guess that's the wrong way to go.

Under Node JS

For an envinrment to align with your package file - it will use NPM - to install the dependencies.
sadly - this seems like an HA thing :man_shrugging:

Remember to run these commands, under the env Node RED is running under (have no idea, how HA does that) - docker maybe?

Why not just install the fork?

The fork is just of the underlying library. Hence why they have updated the nodes package.json to pull it in.

Personally I would repack it outside of HA by cloning the original node, updating the package.json as described. Re run npm install to pull it in, then run npm pack to create a new local tgz file. That can then be loaded into HA using the normal Node-RED install menu.

@marcus-j-davies, thanks I will check in the Home Assistant forums whether someone can provide advice on that.

@Colin, indeed because of what @dceejay explains :slight_smile: