Categories
JavaScript Answers

How to change working directory for npm scripts?

Spread the love

To change working directory for npm scripts, we run cd before running our script.

For instance, we write

cd dir && command -args

in our npm script to change the directory to dir with cd before running command with the -args flags.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *