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

**URL:** https://discourse.nodered.org/t/adjusted-package-json-of-node-red-contrib-spotify-locally-how-to-reload-it-into-node-red/93915
**Category:** General
**Created:** [15 December 2024 17:41 UTC](https://discourse.nodered.org/t/adjusted-package-json-of-node-red-contrib-spotify-locally-how-to-reload-it-into-node-red/93915 "2024-12-15T17:41:16Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![quizzical](https://avatars.discourse-cdn.com/v4/letter/q/48db29/32.png) [@quizzical](https://discourse.nodered.org/u/quizzical)
#### Post date: [15 December 2024 17:41 UTC](https://discourse.nodered.org/t/adjusted-package-json-of-node-red-contrib-spotify-locally-how-to-reload-it-into-node-red/93915/1 "2024-12-15T17:41:16Z")

</div>

Sorry this is probably a silly question.

I saw that [node-red-contrib-spotify](https://github.com/pckhib/node-red-contrib-spotify) does not have all Spotify API functionalities.  
Essentially node-red-contrib-spotify is a wrapper around [spotify-web-api-node](https://github.com/thelinmichael/spotify-web-api-node) which is missing these functionalities.  
I see that [this fork](https://github.com/sergencug/spotify-web-api-node) 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.

---

<div class="post-metadata">

### Author: ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)
#### Post date: [15 December 2024 18:41 UTC](https://discourse.nodered.org/t/adjusted-package-json-of-node-red-contrib-spotify-locally-how-to-reload-it-into-node-red/93915/2 "2024-12-15T18:41:32Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![quizzical](https://avatars.discourse-cdn.com/v4/letter/q/48db29/32.png) [@quizzical](https://discourse.nodered.org/u/quizzical)
#### Post date: [15 December 2024 18:53 UTC](https://discourse.nodered.org/t/adjusted-package-json-of-node-red-contrib-spotify-locally-how-to-reload-it-into-node-red/93915/3 "2024-12-15T18:53:00Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)
#### Post date: [15 December 2024 18:55 UTC](https://discourse.nodered.org/t/adjusted-package-json-of-node-red-contrib-spotify-locally-how-to-reload-it-into-node-red/93915/4 "2024-12-15T18:55:27Z")

</div>

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 🤷‍♂️

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

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [15 December 2024 20:19 UTC](https://discourse.nodered.org/t/adjusted-package-json-of-node-red-contrib-spotify-locally-how-to-reload-it-into-node-red/93915/5 "2024-12-15T20:19:30Z")

</div>

> [@quizzical](#):
>
> [this fork](https://github.com/sergencug/spotify-web-api-node) has the missing functionalities

Why not just install the fork?

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [15 December 2024 22:57 UTC](https://discourse.nodered.org/t/adjusted-package-json-of-node-red-contrib-spotify-locally-how-to-reload-it-into-node-red/93915/6 "2024-12-15T22:57:42Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![quizzical](https://avatars.discourse-cdn.com/v4/letter/q/48db29/32.png) [@quizzical](https://discourse.nodered.org/u/quizzical)
#### Post date: [16 December 2024 19:45 UTC](https://discourse.nodered.org/t/adjusted-package-json-of-node-red-contrib-spotify-locally-how-to-reload-it-into-node-red/93915/7 "2024-12-16T19:45:00Z")

</div>

@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 🙂

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [16 March 2025 19:45 UTC](https://discourse.nodered.org/t/adjusted-package-json-of-node-red-contrib-spotify-locally-how-to-reload-it-into-node-red/93915/8 "2025-03-16T19:45:33Z")

</div>

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