How can I get npm start at a different directory?

Solution 1:

This one-liner should work:

npm start --prefix path/to/your/app

Corresponding doc

Solution 2:

Below Command where project is a folder which contains package.json file

npm run --prefix project ${COMMAND}

is working as well. Useful in Docker based applications.

Solution 3:

I came here from google so it might be relevant to others: for yarn you could use:

yarn --cwd /path/to/your/app run start 

Solution 4:

npm start --prefix path/to/your/app

& inside package.json add the following script

"scripts": {
   "preinstall":"cd $(pwd)"
}