项目结构:-
/root
lerna.json
package.json
/package1
package.json
/localpackage1
/root/lerna.json
{
"packages": [
"package1"
],
"version": "0.0.0",
"npmClient": "yarn",
"useWorkspaces": true
}
/root/package.json
{
"name": "root",
"private": true,
"workspaces": [
"package1"
]
}
/root/package1/package.json
"name": "@blah/blah",
"private": true,
"version": "1.0.0",
"main": "index.js",
"license": "ISC",
"workspaces": {
"packages": [
"localpackage1"
]
},
现在,如果我从package1目录中运行yarn install
,则安装不会出现问题。但是,如果我从根目录中运行lerna bootstrap
,则会收到此错误:-
Couldn't find package "localpackage1" required by "package1" on the "npm" registry.
因此,似乎lerna boostrap不尊重在package1 package.json中找到的工作区配置。我已经尝试过lerna bootstrap --force-local
,但这不起作用-我收到相同的错误消息。有谁知道这是一个解决方案?谢谢。