# Uploading node\_modules

**URL:** <https://community.hubspot.com/t/uploading-node-modules/83932>\
**Category:** CMS Development\
**Tags:** local-development\
**Created:** [June 22, 2023, 3:10pm UTC](https://community.hubspot.com/t/uploading-node-modules/83932 "2023-06-22T15:10:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![icheshire](https://avatars.discourse-cdn.com/v4/letter/i/bb73d2/32.png) [@icheshire](https://community.hubspot.com/u/icheshire)\
**Post date:** [June 22, 2023, 3:10pm UTC](https://community.hubspot.com/t/uploading-node-modules/83932/1 "2023-06-22T15:10:09Z")

</div>

Hey, I found out today that I can’t upload node\_modules because it’s blocked by hubspot. I get that node\_modules isn’t ideal, but how else am I supposed to keep track of dependencies? I don’t think manually uploading every external dependency I need, or using a CDN, is a realistic solution because there’s no way to manage and update my dependencies.

---

<div class="post-metadata">

**Author:** ![alyssamwilie](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/alyssamwilie/32/2072_2.png) [@alyssamwilie](https://community.hubspot.com/u/alyssamwilie)\
**Post date:** [June 23, 2023, 12:48pm UTC](https://community.hubspot.com/t/uploading-node-modules/83932/2 "2023-06-23T12:48:03Z")

</div>

You should really be using a source code repository like BitBucket or GitHub to store and track your files. The HubSpot Design Manager is not meant to be a respository, but a manager for compiled files only. Also, if you’re not already using it, I suggest using the [HubSpot CLI](https://developers.hubspot.com/docs/cms/developer-reference/local-development-cli) to upload your compiled files.

_Moderator note: While this solution may not address the original poster’s specific situation, it could be helpful for other community members facing similar challenges._

---

<div class="post-metadata">

**Author:** ![icheshire](https://avatars.discourse-cdn.com/v4/letter/i/bb73d2/32.png) [@icheshire](https://community.hubspot.com/u/icheshire)\
**Post date:** [June 26, 2023, 1:46am UTC](https://community.hubspot.com/t/uploading-node-modules/83932/3 "2023-06-26T01:46:57Z")

</div>

No, I wanted to use the files in node modules - node modules for frontend usually have a compiled `dist` folder. I know it’s wasteful to upload the whole thing, but how else do I get tracked and organized dependencies for hubspot?

---

<div class="post-metadata">

**Author:** ![alyssamwilie](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/alyssamwilie/32/2072_2.png) [@alyssamwilie](https://community.hubspot.com/u/alyssamwilie)\
**Post date:** [June 26, 2023, 12:47pm UTC](https://community.hubspot.com/t/uploading-node-modules/83932/4 "2023-06-26T12:47:29Z")

</div>

Files in node\_modules should [never be referenced directly](https://stackoverflow.com/questions/59618630/is-it-ok-to-refer-to-node-modules-directly#answer-59619241) in the project as that’s not how pcakages are meant to be used. Ideally the files should be getting compiled into your own files using imports and/or a [bundler](https://snipcart.com/blog/javascript-module-bundler). If you aren’t comfortable with using bundlers and aren’t using very many packages you could instead use CDN or copy/paste the dist files directly into your project. Also, due to it’s normally large size, node\_modules shouldn’t ever be tracked but instead managed with a [package manager](https://www.digitalocean.com/community/tutorials/how-to-use-node-js-modules-with-npm-and-package-json).

_Moderator note: While this solution may not address the original poster’s specific situation, it could be helpful for other community members facing similar challenges._

---

<div class="post-metadata">

**Author:** ![icheshire](https://avatars.discourse-cdn.com/v4/letter/i/bb73d2/32.png) [@icheshire](https://community.hubspot.com/u/icheshire)\
**Post date:** [June 26, 2023, 4:13pm UTC](https://community.hubspot.com/t/uploading-node-modules/83932/5 "2023-06-26T16:13:08Z")

</div>

But how would you do that using github / hubspot CMS?

---

<div class="post-metadata">

**Author:** ![SKumar15](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@SKumar15](https://community.hubspot.com/u/SKumar15)\
**Post date:** [July 3, 2023, 1:30pm UTC](https://community.hubspot.com/t/uploading-node-modules/83932/6 "2023-07-03T13:30:58Z")

</div>

Hello @icheshire , I am not exactly aware of your development workflow.  
But in the case of design manager and custom code workflows and serverless functions, You have to generate a bundle file and upload it to the place where you need it. There’s no direct way of uploading node\_modules to hubspot cms because it is not meant for that.  
Here is an example for custom code : [How to Use NPM Packages in Custom Code Workflow Actions](https://developers.hubspot.com/blog/how-to-use-npm-packages-in-custom-code-workflow-actions)

_Moderator note: While this solution may not address the original poster’s specific situation, it could be helpful for other community members facing similar challenges._

---

<div class="post-metadata">

**Author:** ![icheshire](https://avatars.discourse-cdn.com/v4/letter/i/bb73d2/32.png) [@icheshire](https://community.hubspot.com/u/icheshire)\
**Post date:** [July 3, 2023, 1:34pm UTC](https://community.hubspot.com/t/uploading-node-modules/83932/7 "2023-07-03T13:34:01Z")

</div>

Isn’t this for workflows, and not hubspot CMS?

---

<div class="post-metadata">

**Author:** ![SKumar15](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@SKumar15](https://community.hubspot.com/u/SKumar15)\
**Post date:** [July 3, 2023, 1:41pm UTC](https://community.hubspot.com/t/uploading-node-modules/83932/8 "2023-07-03T13:41:12Z")

</div>

Yes, this is for workflows, but you have to do a similar thing for cms as well, compile the modules in a bundle, upload it to the design manager using cli or directly, and then import it in the module using require\_js or use the bundle globally and use the require function to get access to packages within the bundle.
