How can I get npm start at a different directory?

后端 未结 6 1095
野的像风
野的像风 2020-12-07 08:11

I usually cd into the app directory and then run npm start.

It is my feeling that there ought to be some way to run npm start

6条回答
  •  轮回少年
    2020-12-07 08:29

    This one-liner should work too:

    (cd /path/to/your/app && npm start)
    

    Note that the current directory will be changed to /path/to/your/app after executing this command. To preserve the working directory:

    (cd /path/to/your/app && npm start && cd -)
    

    I used this solution because a program configuration file I was editing back then didn't support specifying command line arguments.

提交回复
热议问题