autorest.typescript icon indicating copy to clipboard operation
autorest.typescript copied to clipboard

Failed to install '@autorest/typescript' - '6.0.0-beta.20'

Open andrsmith149 opened this issue 3 years ago • 14 comments
trafficstars

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 avatar Jun 22 '22 00:06 andrsmith149

@andrsmith149 which node version are you using ? can you try node v14+ ?

qiaozha avatar Jun 22 '22 02:06 qiaozha

@qiaozha Im using Node v17.9.0

andrsmith149 avatar Jun 22 '22 16:06 andrsmith149

@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.

sarangan12 avatar Jun 22 '22 18:06 sarangan12

After runnint autorest --reset and trying again, I am seeing the same issue.

During the installation: image

Result: image

andrsmith149 avatar Jun 22 '22 18:06 andrsmith149

I am able to successfully generate the CSharp, Python and PowerShell SDKs.

andrsmith149 avatar Jun 22 '22 18:06 andrsmith149

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?

sarangan12 avatar Jun 22 '22 18:06 sarangan12

npm i @autorest/typscript was successful: image

I then ran autorest --rest again and tried to generate the SDK again but failed with the same issue.

andrsmith149 avatar Jun 22 '22 19:06 andrsmith149

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?

sarangan12 avatar Jun 22 '22 20:06 sarangan12

Still having the same issue. I can confirm I'm running autorest v3.5.1 as well.

andrsmith149 avatar Jun 22 '22 21:06 andrsmith149

@sarangan12 Are there any other recommended solutions/workarounds? (this is the same user as andrsmith149, just logged in with a different account 😊)

The-DevBlog avatar Jun 29 '22 17:06 The-DevBlog

@AndrewCS149 Can you try to remove .autorest folder in your home directory ? and try again see if it can work ?

qiaozha avatar Jul 12 '22 04:07 qiaozha

@qiaozha Also impacted by this same issue which blocks typescript generation. Deleting .autorest folder does not resolve for us.

chrissmiller avatar Jul 15 '22 18:07 chrissmiller

@chrissmiller have you run autorest --reset first before you delete that folder ?

qiaozha avatar Jul 18 '22 02:07 qiaozha

@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.

The-DevBlog avatar Jul 18 '22 16:07 The-DevBlog

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)

tzkameleo avatar Jun 06 '23 15:06 tzkameleo