简体   繁体   English

如何在lerna exec中设置作用域标志?

[英]How to set the scope flag in lerna exec?

I'm trying to run a script in lerna that would execute on all components within a specific folder. 我试图在lerna中运行一个脚本,该脚本将在特定文件夹内的所有组件上执行。

So I'm trying to run something like 所以我正在尝试运行类似

lerna --scope src/subfolder/subfolder exec -- npm run myScript

But I get this error: 但是我得到这个错误:

Error: No packages found that match scope 'src/subfolder/subfolder'

I have tried to use different kinds of paths but none of them worked. 我尝试使用不同种类的路径,但没有一个起作用。 What is the proper way of using the scope flag? 使用范围标志的正确方法是什么?

Normally, the scope flag should match your repo name in package.json 通常,范围标志应与package.json中的回购名称匹配

In your case, it seems that you should register your script folder as a package of your repo, then you can run your script in that package. 在您的情况下,您似乎应该将脚本文件夹注册为回购软件包,然后可以在该软件包中运行脚本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM