Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
919 views
in Technique[技术] by (71.8m points)

node.js - How can I get npm start at a different directory?

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 with a path parameter. But, the npm start documentation contains no such feature.

I tried myself only to find npm start ./myapp does not work. Is there a way to do that?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This one-liner should work:

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

Corresponding doc


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...