typespec icon indicating copy to clipboard operation
typespec copied to clipboard

[Bug]: Open API to TSP failing "openapi3-to-tsp@*' is not in this registry."

Open Palving opened this issue 2 years ago • 2 comments

Describe the bug

Cant seem to find any other similar issues and I'm rather new to npm

Trying to convert an OpenAPI spec to Typespec with the following commands

npm install @typespec/openapi npx openapi3-to-tsp compile --output-dir "./tsp-output" "./swagger.yml"

Generates the following output

npm error code E404 npm error 404 Not Found - GET https://registry.npmjs.org/openapi3-to-tsp - Not found npm error 404 npm error 404 'openapi3-to-tsp@*' is not in this registry. npm error 404 npm error 404 Note that you can also install from a npm error 404 tarball, folder, http url, or git url.

Reproduction

npm install @typespec/openapi npx openapi3-to-tsp compile --output-dir "./tsp-output" "./swagger.yml"

Checklist

Palving avatar Aug 28 '24 08:08 Palving

@Palving Thanks for opening an issue. The CLI is part of the @typespec/openapi3 package and is named tsp-openapi3. https://typespec.io/docs/next/emitters/openapi3/cli

There is a @typespec/openapi package but that's not the same.

If you're running this outside of an npm project, you'll likely want to globally install the package first: npm install -g @typespec/openapi3 Then you should be able to run tsp-openapi3 from anywhere.

chrisradek avatar Aug 28 '24 16:08 chrisradek

Worked! Thank you :)

Palving avatar Aug 29 '24 06:08 Palving