我有这个文件夹树:
my_project_tree
|
├── lerna.json
├── package.json
├── package-lock.json
├── packages
│ └── editor_implementation
│ ├── dist
│ ├── package.json
│ └── src
│
├── yarn-error.log
└── yarn.lock
我的 editor_implementation/package.json 有以下内容:
{
"name": "@my_project_tree/editor_implementation",
"version": "1.0.0",
"main": "index.js",
"license": "MIT"
}
我的根文件夹 my_project_tree/package.json 具有以下内容:
{
"name": "hocotext",
"version": "1.0.0",
"description": "",
"main": "index.js",
"workspaces": [
"packages/*"
],
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"dotenv": "^6.0.0"
},
"devDependencies": {
"lerna": "^3.4.0"
}
}
我在根级别的 lerna.json 具有以下内容:
{
"version": "patch",
"command": {
"publish": {
"ignoreChanges": [
"ignored-file",
"node_modules",
"*.md"
]
},
"bootstrap": {
"ignore": "component-*",
"npmClientArgs": ["--no-package-lock"]
}
},
"npmClient": "yarn",
"useWorkspaces": true,
"packages": ["packages/*"]
}
当我从根运行时:
- yarn 工作区包/editor_implementation 添加°一些包°
- yarn workspace packages/* 添加°一些包°
- lerna 添加°一些包°
所有命令都失败并带有可抽象为的消息:
知道包...
未找到包 {}...
我无法弄清楚出了什么问题,因为在我看来,我已经遵循了所有要求,如果有人有任何提示,那就太好了。