我需要通过openapi-generator-configuration生成API的ts方案,但出现错误。
我通过npm全局安装了openapi-generator-axios。然后我在我的React项目的根文件夹中添加了名为swagger.json的文件。当运行命令“openapi-generator-axios generate -i swagger.json -g typescript-axios -o src/api”时发生错误:
C:\Users\[I am]\AppData\Roaming\npm\node_modules\@openapitools\openapi-generator-cli\main.js:673
error ? reject(new Error(stderr)) : resolve(stdout);
^
Error: "java" �� ���� ����७��� ��� ���譥�
��������, �ᯮ��塞�� �ணࠬ��� ��� ������ 䠩���.
at C:\Users\[I am]\AppData\Roaming\npm\node_modules\@openapitools\openapi-generator-cli\main.js:673:32
at ChildProcess.exithandler (node:child_process:430:5)
at ChildProcess.emit (node:events:514:28)
at maybeClose (node:internal/child_process:1105:16)
at Socket.<anonymous> (node:internal/child_process:457:11)
at Socket.emit (node:events:514:28)
at Pipe.<anonymous> (node:net:337:12)
字符串
请告诉我怎么了?
2条答案
按热度按时间lf3rwulv1#
删除旧版本的Java https://www.java.com/en/download/uninstalltool.jsp
eulz3vhy2#
解决了
openapi-generator-cli
需要安装Java。