You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running openapi-generator-cli generate with yarn (with the below defined script from package.json) it will ignore my openapitools.json, but it works if npm run is used instead. The effect of this is that different team members can get different versions of the cli.
This issue seems to be related to how the root of the project is fetched to find the config file, depending on if yarn or npm is used. In the case of yarn it will get a path like /d/{my_project_path} and after using path.resolve on the path the resulting config file path will be D:\d\{my_project_path}, which will not work of course.
I have tracked the problem to this issue and this commit where the added default process.env.PWD will generate the above issue, while process.env.INIT_CWD and process.cwd() would have given a correct path. After removing process.env.PWD from the node_modules instance the config is read correctly in yarn.
Is this to be considered a bug? Or does it exist a work around other than using npm instead of yarn?
When running
openapi-generator-cli generate
with yarn (with the below defined script from package.json) it will ignore myopenapitools.json
, but it works if npm run is used instead. The effect of this is that different team members can get different versions of the cli.This issue seems to be related to how the root of the project is fetched to find the config file, depending on if yarn or npm is used. In the case of yarn it will get a path like
/d/{my_project_path}
and after usingpath.resolve
on the path the resulting config file path will beD:\d\{my_project_path}
, which will not work of course.I have tracked the problem to this issue and this commit where the added default
process.env.PWD
will generate the above issue, whileprocess.env.INIT_CWD
andprocess.cwd()
would have given a correct path. After removingprocess.env.PWD
from the node_modules instance the config is read correctly in yarn.Is this to be considered a bug? Or does it exist a work around other than using npm instead of yarn?
openapitools.json:
package.json (exerpt):
yarn openapi-generator-cli generate
in project root2.4.26
1.22.4
14.19.0
Windows server 2016
The text was updated successfully, but these errors were encountered: