3

I have a script in package.json that runs as expected when using the standard .env file.

"scripts": {
  "commands": "ts-node-dev --files deploy-commands.ts",
},

but when I try specify a different .env file (.env.prod)

"scripts": {
  "commands": "dotenv -e .env.prod ts-node-dev --files deploy-commands.ts",
},

I get the error:

ts-node-dev: no script to run provided

1 Answer 1

6

According to the dotenv-cli documentation you'll need to use -- if you want to pass flags to the inner command. In your case, the following should work:

dotenv -e .env.prod -- ts-node-dev --files deploy-commands.ts
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.