La Min Ko Ko
La Min Ko Ko

Reputation: 11

"ENVIRONMENT" is not recognized as an internal or external command, operable command or batch file

I found this error when I run in next js. The script text is ▷ Debug

"scripts": {

"dev: "ENVIRONMENT=env/.env.development next dev", "check": "npm run format && npm run eslint", "eslint": "eslint --ext .jsx,.js components/ pages/",

"format": }

Upvotes: 0

Views: 931

Answers (1)

otomir23
otomir23

Reputation: 16

NextJS has built-in support for loading env variables from .env.local and .env.development, so try to use that.

If you need to pass custom env file, at least you need to put the ENVIRONMENT argument after next dev, not before.

Upvotes: 0

Related Questions