# Npm install - missing node modules

**URL:** <https://discourse.nodered.org/t/npm-install-missing-node-modules/94885>\
**Category:** General\
**Created:** [24 January 2025 19:50 UTC](https://discourse.nodered.org/t/npm-install-missing-node-modules/94885 "2025-01-24T19:50:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [24 January 2025 19:50 UTC](https://discourse.nodered.org/t/npm-install-missing-node-modules/94885/1 "2025-01-24T19:50:09Z")

</div>

I'm using a script to backup the `.node-red` directory MINUS the `node_modules` directory & contents (due to it's size), and writing up the restore process for when I need it.

Am I right in thinking that the process to rebuild the missing `node_modules`, would be;

```auto
cd .node-red && npm install

```

Which would enable npm to create the missing `node_modules` directory, and populate it with the required modules detailed in the `package.json`, or would the `node_modules` directory have to be created manually first?

---

<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:** [24 January 2025 20:35 UTC](https://discourse.nodered.org/t/npm-install-missing-node-modules/94885/2 "2025-01-24T20:35:59Z")

</div>

Yup, that is correct. 🙂 You don't need to create the folder, it will be created by npm.

---

<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:** [7 February 2025 20:36 UTC](https://discourse.nodered.org/t/npm-install-missing-node-modules/94885/3 "2025-02-07T20:36:06Z")

</div>

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