# When i want to add my Node app in Environment variables this error apears "FATAL ERROR: jwtPrivateKey is not Defined" , this is my error message but i set the ENV but not work how to fix this issue?

**URL:** <https://forum.codewithmosh.com/t/when-i-want-to-add-my-node-app-in-environment-variables-this-error-apears-fatal-error-jwtprivatekey-is-not-defined-this-is-my-error-message-but-i-set-the-env-but-not-work-how-to-fix-this-issue/15012>\
**Category:** Node\
**Created:** [September 8, 2022, 1:50pm UTC](https://forum.codewithmosh.com/t/when-i-want-to-add-my-node-app-in-environment-variables-this-error-apears-fatal-error-jwtprivatekey-is-not-defined-this-is-my-error-message-but-i-set-the-env-but-not-work-how-to-fix-this-issue/15012 "2022-09-08T13:50:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![abdirisak](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/abdirisak/32/4346_2.png) [@abdirisak](https://forum.codewithmosh.com/u/abdirisak)\
**Post date:** [September 8, 2022, 1:50pm UTC](https://forum.codewithmosh.com/t/when-i-want-to-add-my-node-app-in-environment-variables-this-error-apears-fatal-error-jwtprivatekey-is-not-defined-this-is-my-error-message-but-i-set-the-env-but-not-work-how-to-fix-this-issue/15012/1 "2022-09-08T13:50:08Z")

</div>

Environment variables error in node course section Authentication and Authorization

---

<div class="post-metadata">

**Author:** ![sharaf19](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@sharaf19](https://forum.codewithmosh.com/u/sharaf19)\
**Post date:** [October 10, 2023, 7:42pm UTC](https://forum.codewithmosh.com/t/when-i-want-to-add-my-node-app-in-environment-variables-this-error-apears-fatal-error-jwtprivatekey-is-not-defined-this-is-my-error-message-but-i-set-the-env-but-not-work-how-to-fix-this-issue/15012/3 "2023-10-10T19:42:34Z")

</div>

i was facing the same problem so to fix it use the below command in your cmd…

- Open command line

- **setx vidly\_jwtPrivateKey mySecureKey**

(write the above line without ‘=’ sign)

after that close your text editor and re-open and start the application, your app should work properly.
