Npm 纱线-工作区-勒纳-我无法使用工作区功能添加我的包
我有一个文件夹树:Npm 纱线-工作区-勒纳-我无法使用工作区功能添加我的包,npm,yarnpkg,lerna,yarn-workspaces,Npm,Yarnpkg,Lerna,Yarn Workspaces,我有一个文件夹树: my_project_tree | ├── lerna.json ├── package.json ├── package-lock.json ├── packages │ └── editor_implementation │ ├── dist │ ├── package.json │ └── src │ ├── yarn-error.log └── yarn.lock My editor_implementa
my_project_tree
|
├── lerna.json
├── package.json
├── package-lock.json
├── packages
│ └── editor_implementation
│ ├── dist
│ ├── package.json
│ └── src
│
├── yarn-error.log
└── yarn.lock
My editor_implementation/package.json包含以下内容:
{
"name": "@my_project_tree/editor_implementation",
"version": "1.0.0",
"main": "index.js",
"license": "MIT"
}
{
"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"
}
}
{
"version": "patch",
"command": {
"publish": {
"ignoreChanges": [
"ignored-file",
"node_modules",
"*.md"
]
},
"bootstrap": {
"ignore": "component-*",
"npmClientArgs": ["--no-package-lock"]
}
},
"npmClient": "yarn",
"useWorkspaces": true,
"packages": ["packages/*"]
}
我的根文件夹my_project_tree/package.json包含以下内容:
{
"name": "@my_project_tree/editor_implementation",
"version": "1.0.0",
"main": "index.js",
"license": "MIT"
}
{
"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"
}
}
{
"version": "patch",
"command": {
"publish": {
"ignoreChanges": [
"ignored-file",
"node_modules",
"*.md"
]
},
"bootstrap": {
"ignore": "component-*",
"npmClientArgs": ["--no-package-lock"]
}
},
"npmClient": "yarn",
"useWorkspaces": true,
"packages": ["packages/*"]
}
根级别的My lerna.json包含以下内容:
{
"name": "@my_project_tree/editor_implementation",
"version": "1.0.0",
"main": "index.js",
"license": "MIT"
}
{
"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"
}
}
{
"version": "patch",
"command": {
"publish": {
"ignoreChanges": [
"ignored-file",
"node_modules",
"*.md"
]
},
"bootstrap": {
"ignore": "component-*",
"npmClientArgs": ["--no-package-lock"]
}
},
"npmClient": "yarn",
"useWorkspaces": true,
"packages": ["packages/*"]
}
当我从根目录运行时:
- 纱线工作区软件包/编辑器_实现添加°一些软件包°
- 纱线工作区包装/*添加若干包装°
- lerna添加一些包°
我无法找出问题所在,因为在我看来,我有以下所有要求,如果有人有任何提示,那就太好了。为了发现您的工作区,您只需运行:
yarn workspaces info
在我的情况下,它返回:
{
"@hoco_editor/editor_implementation": {
"location": "packages/editor_implementation",
"workspaceDependencies": [],
"mismatchedWorkspaceDependencies": []
}
}
因此,我使用@hoco_editor/editor_实现运行命令,如下所示:
yarn workspace @hoco_editor/editor_implementation add °some packages°
它就像一个符咒 现在,我正在搜索
warn workspace
,以便在同一移动中的所有包上添加模块。