Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

140
Views
How to use .env variable in npm script

In my .env I have the following variable:

SHOPIFY_STORE_URL=mystore.myshopify.com

Now I want to use this variable in a npm script:

  "scripts": {
    "shopify-login": "shopify login --store=SHOPIFY_STORE_URL",
  },

so $ npm run shopify-login should execute $ shopify login --store=mystore.myshopify.com

How can I achieve this?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

When you are on a linux/mac operating system - this should work:

# .env
SHOPIFY_STORE_URL=mystore.myshopify.com

my test case:

  "scripts": {
    "shopify-login": "source .env && echo $SHOPIFY_STORE_URL"
  }

your test case:

  "scripts": {
    "shopify-login": "source .env && shopify login --store=$SHOPIFY_STORE_URL",
  },
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!