autorest.typescript
autorest.typescript copied to clipboard
Failed to install '@autorest/typescript' - '6.0.0-beta.20'
Operating System: Win11 Autorest core version: 3.8.4 NPM version: 8.5.5
I'm running into an issue when trying to run a typescript build.
Commands Run
autorest --typescript --input-file=.\swagger.json --output-folder=C:\path\to\output\folder\typescriptSDK --v3 --verbose
I end up receiving the following error:
Installing AutoRest extensions `@autorest/typscript' (latest -> 6.0.0-beta.20)
Error: Package '@autorest/typscript' - 'latest -> 6.0.0-beta.20' failed to install:
Failed to install package 'https://registry.npmjs.org/@autorest/typescript/-/typescript-6.0.0-beta.20.tgz' -- Error: Process Failed.
When I look into my '.autorest' folder, I can confirm that the typescript extension is not present.
@andrsmith149 which node version are you using ? can you try node v14+ ?
@qiaozha Im using Node v17.9.0
@andrsmith149 Can you confirm if this is not a transient issue? Could you please try again? Also, can you run the command autorest --reset and then try it.
After runnint autorest --reset and trying again, I am seeing the same issue.
During the installation:

Result:

I am able to successfully generate the CSharp, Python and PowerShell SDKs.
I would like to check if I can isolate the issue somehow. Can you confirm if npm i @autorest/typescript command is working fine on your machine?
npm i @autorest/typscript was successful:

I then ran autorest --rest again and tried to generate the SDK again but failed with the same issue.
Thanks for updating the details. So, it seems the @autorest\typescript is able to install on your machine. So, can you try something else:
npm uninstall -g autorest
npm install -g [email protected]
Now can you try regenerating?
Still having the same issue. I can confirm I'm running autorest v3.5.1 as well.
@sarangan12 Are there any other recommended solutions/workarounds? (this is the same user as andrsmith149, just logged in with a different account 😊)
@AndrewCS149 Can you try to remove .autorest folder in your home directory ? and try again see if it can work ?
@qiaozha Also impacted by this same issue which blocks typescript generation. Deleting .autorest folder does not resolve for us.
@chrissmiller have you run autorest --reset first before you delete that folder ?
@qiaozha I tried running autorest --reset then deleting the ./autorest folder and then regenerating the TypeScript SDK but failed with the same error. I'm not too concerned about this anymore since I was able to get it to work from a different computer. I'm not sure why it will not work on this other computer.
I have similar problem, tried with administrative powershell, disabled windows defender
AutoRest code generation utility [cli version: 3.6.3; node: v18.15.0] (C) 2018 Microsoft Corporation. https://aka.ms/autorest info | AutoRest core version selected from configuration: ~2.0.4413. Loading AutoRest core 'C:\Users\[email protected]@2.0.4421\[email protected]\autorest-core\dist' (2.0.4421) No configuration found at 'file:///C:/KameleoDev/client-api-typescript/'. Installing AutoRest extension '@microsoft.azure/autorest.typescript' (~4.2.0) VERBOSE: Installing @microsoft.azure/autorest.typescript, 4.2.4 VERBOSE: Error: Failed to install package 'https://registry.npmjs.org/@microsoft.azure/autorest.typescript/-/autorest.typescript-4.2.4.tgz' -- Error: Process Failed. VERBOSE: Error: Failed to install package 'https://registry.npmjs.org/@microsoft.azure/autorest.typescript/-/autorest.typescript-4.2.4.tgz' -- Error: Process Failed. at install (/node_modules/@microsoft.azure/extension/dist/main.js:303:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async ExtensionManager.installPackage (/node_modules/@microsoft.azure/extension/dist/main.js:472:13) at async Configuration.CreateView (C:\Users\[email protected]@2.0.4421\[email protected]\autorest-core\dist\lib\configuration.js:685:51) at async AutoRest.RegenerateView (C:\Users\[email protected]@2.0.4421\[email protected]\autorest-core\dist\lib\autorest-core.js:55:29) at async currentMain (C:\Users\[email protected]@2.0.4421\[email protected]\autorest-core\dist\app.js:303:20) at async mainImpl (C:\Users\[email protected]@2.0.4421\[email protected]\autorest-core\dist\app.js:506:20) at async main (C:\Users\[email protected]@2.0.4421\[email protected]\autorest-core\dist\app.js:530:20) VERBOSE: Cleaning up failed installation: C:\Users\[email protected][email protected] Failed to install or start extension '@microsoft.azure/autorest.typescript' (~4.2.0) Error: Package '@microsoft.azure/autorest.typescript' - '4.2.4' failed to install: Failed to install package 'https://registry.npmjs.org/@microsoft.azure/autorest.typescript/-/autorest.typescript-4.2.4.tgz' -- Error: Process Failed.Error: Failed to install package 'https://registry.npmjs.org/@microsoft.azure/autorest.typescript/-/autorest.typescript-4.2.4.tgz' -- Error: Process Failed. at install (/node_modules/@microsoft.azure/extension/dist/main.js:303:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async ExtensionManager.installPackage (/node_modules/@microsoft.azure/extension/dist/main.js:472:13) at async Configuration.CreateView (C:\Users\[email protected]@2.0.4421\[email protected]\autorest-core\dist\lib\configuration.js:685:51) at async AutoRest.RegenerateView (C:\Users\[email protected]@2.0.4421\[email protected]\autorest-core\dist\lib\autorest-core.js:55:29) at async currentMain (C:\Users\[email protected]@2.0.4421\[email protected]\autorest-core\dist\app.js:303:20) at async mainImpl (C:\Users\[email protected]@2.0.4421\[email protected]\autorest-core\dist\app.js:506:20) at async main (C:\Users\[email protected]@2.0.4421\[email protected]\autorest-core\dist\app.js:530:20)