NODE_ENV not being picked
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 641
- Forks
- 41
- PR merge metrics
- No merged PRs in 30d
Description
Environment
Node v20/v22 LTS
Windows 10
pnpm v10
Reproduction
import { defineNuxtConfig } from 'nuxt/config';
import { isDevelopment, nodeENV } from 'std-env';
console.log(process.env.NODE_ENV, { isDevelopment, nodeENV });
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
compatibilityDate: '2025-08-15',
devtools: { enabled: true },
});
Running pnpm dev
Describe the bug
Likely not a bug with the package, but I'm trying to investigate.
nodeENV returns an empty string, and isDevelopment is false, despite process.env.NODE_ENV being development. Could you possibly give me pointers on what may be causing my environment to have this? I am happy to investigate myself and report back + close issue.
Additional context
No response
Logs
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the provided Nuxt configuration reproduction and run pnpm dev on the stated Node and Windows environment, comparing process.env.NODE_ENV with nodeENV and isDevelopment. Trace the environment values exposed by std-env and document the cause or a reproducible fix, with regression coverage if the repository has a relevant test entry point.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, nuxtjs, typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100