Failed to install or start extension - cannot read property 'startsWith' of underfined.
See original GitHub issueDescribe the bug autorest version: 3.0.6339 autorest command (they both fail):
autorest readme.md --csharp --csharp-sdks-folder=../../CSharp/ --target=Api.Labs --nsversion=v2020_05_01_preview
autorest readme.md --typescript --typescript-sdks-folder=../../TypeScript --target=Api.Labs --nsversion=v2020_05_01_preview
Issue: Whenever I run the above commands, I get this error message:
Failed to install or start extension '@microsoft.azure/autorest.csharp' (2.3.91)
TypeError: Cannot read property 'startsWith' of undefined
or
Failed to install or start extension '@microsoft.azure/autorest.typescript' (4.2.4)
TypeError: Cannot read property 'startsWith' of undefined
I have tried autorest --reset
, does not help (also npm cache clean --force
). I installed autorest@3.1.5 and ran the same command, it succeeds in installing the extensions to the .autorest folder, but errors out on a different issue ( #4056 ). So if I use that to install the extensions, then go back to 3.0.6339, it still fails. My .autorest folder has these installed:
@autorest_core@3.0.6375
@autorest_core@3.1.3
@autorest_csharp@3.0.0-beta.20210412.4
@autorest_modelerfour@4.15.421
@autorest_modelerfour@4.15.456
@autorest_modelerfour@4.17.2
@autorest_typescript@6.0.0-alpha.20210309.1
@autorest_typescript@6.0.0-dev.20201105.2
@microsoft.azure_autorest.csharp@2.3.91
@microsoft.azure_autorest.modeler@2.3.51
@microsoft.azure_autorest.modeler@2.3.55
@microsoft.azure_autorest.typescript@4.2.4
This was working fine yesterday and this morning, and with 0 changes to my openapi spec it has started failing. Uninstalling and re-installing autorest does not help. 3.0 is completely unusable for me now (tried a few versions) and 3.1 errors out with the linked issue above.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
I was able to get autorest 3.1 working (thanks to your help!) with the the pinned csharp and typescript versions - so I am not too concerned about this issue anymore. Unless you want to understand why it is not defaulting to v2?
can you try adding to your config either
v2:true
orversion: ~2.0.4413