Cursor IDE caches old .env values, does not reload updated env variables

Describe the Bug

Cursor IDE is not correctly reloading updated .env values. After modifying the .env file, the IDE continues to use cached environment variables from the old .env version. Even after restarting the terminal inside Cursor or re-running the script, the changes are not reflected. This leads to inconsistencies between the actual .env content and what process.env reports.

Steps to Reproduce

Open a Node.js project in Cursor IDE.

Create a .env file with a variable, e.g., PORT=5000.

In a script (a.js), load the .env using require(‘dotenv’).config() and print process.env.PORT.

Run the script — it shows PORT=5000 as expected.

Change the .env file to PORT=5004.

Run the script again — it still shows the old PORT=5000 value.

Try restarting the integrated terminal or even re-opening the project — the old value persists.

Only by fully restarting Cursor IDE does it pick up the correct .env values.

Expected Behavior

The IDE should reload .env values freshly on each execution of the script, or at least after restarting the terminal. It should not cache old .env values across terminal or script restarts within the IDE.

Screenshots / Screen Recordings

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.1, 1.0, 0.50

Does this stop you from using Cursor

Yes - Cursor is unusable