npm script command to run a script command from another package.json

后端 未结 3 1058
情书的邮戳
情书的邮戳 2021-02-02 07:20

I have two separate projects that use npm - so I have both :
some_base_folder/projectA/package.json and some_base_folder/projectB/package.json

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-02 07:59

    You should use --prefix.

    npm run [command] --prefix path/to/your/other/folder
    

    And for yarn:

    yarn --cwd path/to/your/other/folder [command]
    

提交回复
热议问题