[BUG] Error when working with npm workspaces
@kay-schecker 已经在做这个了。
开始于 2022年1月30日。
评估
这个 Issue 还没有评估数据。
描述
🐛 Bug Report:
Describe the bug
The generator crashes with the [error] Required option '-i' is missing error when running with different cwd.
Steps to Reproduce
Steps to reproduce the behavior:
- Create a npm project with two workspaces:
packages/clientandpackages/server(server probably isn't even necessary) - Save a spec in
packages/openapi.yaml - Reference it in
packages/client/openapitools.jsonvia"inputSpec": "../openapi.yaml" - Add a script in client:
"openapi": "openapi-generator-cli generate"and run it- It works ✔️
- Add a script in root
"openapi": "npm run openapi --workspaces --if-present"and run it- See error ❌
- Generates a
openapitools.jsonin the root directory
Failing workaround
I created a packages/client/openapi.js script and let it run in client via "openapi": "node openapi.js" , but this also fails in the same way.
// try forcing the cwd to the client directory (works when checking with pwd command)
const child = require('child_process').exec('openapi-generator-cli generate', { cwd: __dirname });
child.stdout.pipe(process.stdout);
child.stderr.pipe(process.stderr);
child.on('exit', code => process.exit(code));
Expected behavior
I expect the generator to always find the file.
Operation System:
- OS: Windows
- Version 10
Package System:
- npm v8.3.0
- 主要语言
- TypeScript
- 星标
- 2k
- 派生
- 208
- 平均合并
- 9 小时 35 分钟
- 30 天内合并 PR
- 3
环境准备
我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
OpenAPITools/openapi-generator-cli 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
-
[BUG] JAVA_OPTS is incorrectly evaluated可能重新可做 @kay-schecker 于 116 天前认领,目前没有进行中的 PR。 未关闭bug
OpenAPITools/openapi-generator-cli#1213 · 已指派 1 人 ·
-
[BUG] Proxy configuration of NPM not used when downloading .jar via version manager可能重新可做 @kay-schecker 于 171 天前认领,目前没有进行中的 PR。 未关闭bug
OpenAPITools/openapi-generator-cli#1190 · 已指派 1 人 ·
-
[BUG] openapiGeneratorIgnoreList is missing from schema可能重新可做 @kay-schecker 于 221 天前认领,目前没有进行中的 PR。 未关闭bug
OpenAPITools/openapi-generator-cli#1138 · 1 条评论 · 已指派 1 人 ·
-
[BUG] Environment variable not found (missing .env loading)可能重新可做 @kay-schecker 于 260 天前认领,目前没有进行中的 PR。 未关闭bug
OpenAPITools/openapi-generator-cli#1094 · 1 条评论 · 已指派 1 人 ·
查看 OpenAPITools/openapi-generator-cli 的全部 Issue
相似的 Issue
-
resources
难度 2/5 1-3 小时 新手友好度 72/100
railmapgen/rmg-palette#2445 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
danielmiessler/LifeOS#2242 ·
维护者通常 5 天内回复
-
good first issue hacktoberfest help wanted translation
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
callstackincubator/appduct#129 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 88/100