# How to define environment variables via npm?

**URL:** <https://community.n8n.io/t/how-to-define-environment-variables-via-npm/72390>\
**Category:** Questions\
**Created:** [January 24, 2025, 6:12am UTC](https://community.n8n.io/t/how-to-define-environment-variables-via-npm/72390 "2025-01-24T06:12:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmozzart](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jmozzart/32/39758_2.png) [@jmozzart](https://community.n8n.io/u/jmozzart)\
**Post date:** [January 24, 2025, 6:12am UTC](https://community.n8n.io/t/how-to-define-environment-variables-via-npm/72390/1 "2025-01-24T06:12:21Z")

</div>

I’ve been using n8n locally for almost a year via npm. However, I need to assign an environment variable this time, and the documentation only suggests typing `export <variable>=<value>` in the terminal. But when I execute this command, there’s no message displayed, and it seems to be unsuccessful.

Here’s the actual command I tried: `export WORKFLOWS_DEFAULT_NAME=“Test”`. This variable works correctly on my cloud server.

I’ve tried several things so far, but none of them seem to work:

- Removing the quotes in the value didn’t return any message.
- Appending “n8n “ before “export” did return a message: “User settings being loaded from “/Users/kielnicx/.n8n/config””.
- Appending “n8n:” before “export” returned an error.
- Loading a JSON file

I understand that most successful installations and configurations are done using Docker, but I’d prefer to avoid using it for this particular task.

Here’s my system information:

- macOS Sequoia 15.2
- n8n version 1.69.2
- npm version 10.7
- Node version 20.15
- Database: SQLite (default)

My original plan is to disable N8N\_SECURE\_COOKIE so I can access it via local network from an iPad but apparently all of the browsers in iOS/iPadOS are using Safari engine. If you have solution for this part instead that would be great and I can ignore setting up env via npm.

---

<div class="post-metadata">

**Author:** ![n8n](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/n8n/32/196425_2.png) [@n8n](https://community.n8n.io/u/n8n)\
**Post date:** [January 24, 2025, 6:12am UTC](https://community.n8n.io/t/how-to-define-environment-variables-via-npm/72390/2 "2025-01-24T06:12:22Z")

</div>

It looks like your topic is missing some important information. Could you provide the following if applicable.

- **n8n version:**
- **Database (default: SQLite):**
- **n8n EXECUTIONS\_PROCESS setting (default: own, main):**
- **Running n8n via (Docker, npm, n8n cloud, desktop app):**
- **Operating system:**

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [April 24, 2025, 6:13am UTC](https://community.n8n.io/t/how-to-define-environment-variables-via-npm/72390/3 "2025-04-24T06:13:04Z")

</div>

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