Categories JavaScript Answers How to change working directory for npm scripts? Post author By John Au-Yeung Post date September 9, 2022 No Comments on 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. Related Posts How to run the shell 'cd' command to change the working directory with Python?Sometimes, we want to run the shell 'cd' command to change the working directory with… How to change working directory in my current shell context when running a Node.js script?Sometimes, we want to change working directory in my current shell context when running a… How to change directory with Subprocess in Python?Sometimes, we want to change directory with Subprocess in Python. In this article, we'll look… By John Au-Yeung Web developer specializing in React, Vue, and front end development. View Archive → ← How to stub process.env in Node.js? → How to check if token expired using this JWT library in Node.js? Leave a Reply Cancel replyYour email address will not be published. Required fields are marked *Comment * Name * Email * Website Save my name, email, and website in this browser for the next time I comment. Current ye@r * Leave this field empty