# Npm install & update makes Editor unresponsive

**URL:** <https://discourse.nodered.org/t/npm-install-update-makes-editor-unresponsive/35046>\
**Category:** General\
**Created:** [29 October 2020 23:32 UTC](https://discourse.nodered.org/t/npm-install-update-makes-editor-unresponsive/35046 "2020-10-29T23:32:34Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![fdiaz](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fdiaz/32/57365_2.png) [@fdiaz](https://discourse.nodered.org/u/fdiaz)\
**Post date:** [29 October 2020 23:32 UTC](https://discourse.nodered.org/t/npm-install-update-makes-editor-unresponsive/35046/1 "2020-10-29T23:32:35Z")

</div>

Hello All! First time posting here so please excuse any wrongdoing or double posting.

I am running into an issue where if I attempt to update packages/Nodes through the windows CMD using either:  
`npm install`  
or  
`npm update`  
After running either command the Node-Red editor locks up and becomes unresponsive. I believe it is hanging somewhere given that my cursor locks into the last shape, based on what my mouse was hovering over when it becomes unresponsive, but I can't quite put my finger on it.

This happens after I enable the Projects feature and load my project, then run either command for updating packages. I am utilizing UiBuilder so I would like to get @TotallyInformation to share his thoughts, but if I install each package individually through npm or palette manager no problem.

No CMD errors when running `node-red`  
No chrome dev tools console or networking errors  
Happens on multiple versions of Node.js and Node-Red on both Mac and PC.

Any thoughts? Please help.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [30 October 2020 02:05 UTC](https://discourse.nodered.org/t/npm-install-update-makes-editor-unresponsive/35046/2 "2020-10-30T02:05:32Z")

</div>

> [@fdiaz](#):
>
> utilizing UiBuilder

Shouldn't make any difference to the Editor. uibuilder does provide another package manager but that is just for packages that you want uibuilder to make available via ExpressJS to your front-end. You can achieve the same thing by installing packages manually and amending the uibuilder package list file.

One slight thing with uibuilder and Node-RED projects. Currently you have to restart Node-RED if you change projects and are using uibuilder. I have not yet found time to add in the event handling logic to handle live project swaps.

---

<div class="post-metadata">

**Author:** ![fdiaz](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fdiaz/32/57365_2.png) [@fdiaz](https://discourse.nodered.org/u/fdiaz)\
**Post date:** [4 November 2020 04:23 UTC](https://discourse.nodered.org/t/npm-install-update-makes-editor-unresponsive/35046/3 "2020-11-04T04:23:36Z")

</div>

You were absolutely right. UiBuilder had nothing to do with it. I thought it may have been some of the packages it was using.

Turns out an `npm install` creates a node-modules folder in the projects directory that has 5k+ files that lock up the editor trying to load all of those changes in the git projects tab. Is there a way that I should be trying to load the missing nodes other than the `npm install` command? Seems like no one has definitively answered this. I am trying to avoid using the palette manager to install all of the dependencies. @TotallyInformation thank you for responding so quickly by the way. I really appreciate it!

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [4 November 2020 06:47 UTC](https://discourse.nodered.org/t/npm-install-update-makes-editor-unresponsive/35046/4 "2020-11-04T06:47:19Z")

</div>

You shouldn't be installing nodes in your project directory. You install them in the `.node-red` directory.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [4 November 2020 16:04 UTC](https://discourse.nodered.org/t/npm-install-update-makes-editor-unresponsive/35046/5 "2020-11-04T16:04:13Z")

</div>

And that is true of front-end modules deployed via the uibuilder library manager as well.

Also, what dependencies are you having to install? Do you mean just installing nodes? That is really best done from within the palette manager as it avoids making mistakes.

---

<div class="post-metadata">

**Author:** ![fdiaz](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fdiaz/32/57365_2.png) [@fdiaz](https://discourse.nodered.org/u/fdiaz)\
**Post date:** [4 November 2020 21:27 UTC](https://discourse.nodered.org/t/npm-install-update-makes-editor-unresponsive/35046/6 "2020-11-04T21:27:31Z")

</div>

Okay, I think I do mean installing nodes. I am working with a team on this app and attempting to run our dev-ops such that we can install on new machines without much pain, and if dependencies get updated or require a version change there is a foolproof approach to having the same environment amongst us all. I would assume this should be the same way that I ensure the proper nodes and dependencies for end-user deployment through an `npm install`. Is it instead the case that the pallet manager is the only true way to get project nodes over to the local install?

Also thank you both for the help. I'm sure you aren't thanked enough especially for such an amazing tool that is free to use. Really appreciate the time that you put in to help people work through their problems!!!

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [4 November 2020 21:39 UTC](https://discourse.nodered.org/t/npm-install-update-makes-editor-unresponsive/35046/7 "2020-11-04T21:39:46Z")

</div>

The dependency management of projects is one area that needs more work.

The editor helps you get the project's package.json up to date with the modules your flow is using.

It doesn't yet help you get dependencies installed when an updated package.json is loaded.

There may be some tricks you can do with npm - I haven't tried but I wonder if running:

`npm install --prefix ~/.node-red` from within the project's directory will do the right thing. I don't know if that would update the package.json in ~/.node-red which may cause issues later on.

---

<div class="post-metadata">

**Author:** ![fdiaz](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fdiaz/32/57365_2.png) [@fdiaz](https://discourse.nodered.org/u/fdiaz)\
**Post date:** [10 November 2020 16:14 UTC](https://discourse.nodered.org/t/npm-install-update-makes-editor-unresponsive/35046/8 "2020-11-10T16:14:46Z")

</div>

I think I figured out a way that will work for the time being. After some testing and multiple Node-Red uninstalls I found that if I run `npm install <path for project folder>` in the .node-red directory I get all of my nodes installed properly, with the correct versions listed in the project dependencies. For some reason, an `npm outdated` command will tell me that the packages are still missing but starting up node-red reveals that I have everything I need, no unresponsive editor, no 5k+ git changes, smooth sailing. I will test one more time today and confirm that this runs properly on macOS as well.

Thank you for the help!

P.S.: the `<path for project folder>` needs to be the location where the package.json is for your current active project. Example: `npm install .\.node-red\projects\coolApp`

---

<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:** [24 November 2020 16:14 UTC](https://discourse.nodered.org/t/npm-install-update-makes-editor-unresponsive/35046/9 "2020-11-24T16:14:47Z")

</div>

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