我想创建2个单独的程序包-第一个程序包仅应具有package-2
作为依赖项,而package-2
可以具有该程序包所需的任何内容。
我的问题是dependencies
中的package-2
(我们称其为package-3
)之一具有bin脚本。我想将其公开供package-1
使用,但这是行不通的。
在软件包1中运行npm run start
时,出现以下错误:
./bin/sh package-3 is not a command
{
"name": "package-1",
"scripts": {
"start": "package-2 start",
},
"dependencies": {
"package-2": "1.0.0",
}
}
{
"name": "package-2",
"scripts": {
"start": "package-3 start",
},
"dependencies": {
"package-3": "1.0.0",
}
}
{
"name": "package-3",
"bin" : {
"package-3": "cli-with-start-command",
},
}