Alright, so last evening I opened VS Code and found the "Prettier" extension to be missing…Naturally, I searched for it and tried to install it..but apparently it shows this error – "Error while installing ‘Prettier – Code formatter’ extension. Please check the log for more details."
this is what the log mentions:
2023-12-31 09:50:32.450 [warning] Via 'product.json#extensionEnabledApiProposals' extension 'ms-python.python' wants API proposal 'registerIssueDataProvider' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned. 2023-12-31 09:50:33.014 [info] Started local extension host with pid 14752. 2023-12-31 09:50:35.867 [info] [perf] Render performance baseline is 67ms 2023-12-31 09:51:51.436 [error] Error: Unable to write file 'vscode-userdata:/c:/Users/hp/.vscode/extensions/extensions.json' (NoPermissions (FileSystemError): Error: EPERM: operation not permitted, rename 'c:Usershp.vscodeextensionsextensions.json.vsctmp' -> 'c:Usershp.vscodeextensionsextensions.json') at E.writeFile (c:UsershpAppDataLocalProgramsMicrosoft VS CoderesourcesappoutvscodenodesharedProcesssharedProcessMain.js:56:16811) at async Object.factory (c:UsershpAppDataLocalProgramsMicrosoft VS CoderesourcesappoutvscodenodesharedProcesssharedProcessMain.js:100:83319) 2023-12-31 09:51:51.474 [error] Unable to write file 'vscode-userdata:/c:/Users/hp/.vscode/extensions/extensions.json' (NoPermissions (FileSystemError): Error: EPERM: operation not permitted, rename 'c:Usershp.vscodeextensionsextensions.json.vsctmp' -> 'c:Usershp.vscodeextensionsextensions.json'): Error: Unable to write file 'vscode-userdata:/c:/Users/hp/.vscode/extensions/extensions.json' (NoPermissions (FileSystemError): Error: EPERM: operation not permitted, rename 'c:Usershp.vscodeextensionsextensions.json.vsctmp' -> 'c:Usershp.vscodeextensionsextensions.json') at E.writeFile (c:UsershpAppDataLocalProgramsMicrosoft VS CoderesourcesappoutvscodenodesharedProcesssharedProcessMain.js:56:16811) at async Object.factory (c:UsershpAppDataLocalProgramsMicrosoft VS CoderesourcesappoutvscodenodesharedProcesssharedProcessMain.js:100:83319)
The version of VS Code I’m using: 1.85.1(user setup)
OS: Windows 11
Note: I have already tried the below mentioned fixes, but nothing seems to work:
1: Installing from VSIX
2: Running as Administrator
3: Changing the DNS
2
Answers
The error message is pretty clear. It says the file permissions on your
~/.vscode/extensions/extensions.json
file don’t allow for VS Code to modify the file when installing extensions. Somehow the file permissions got changed. Modify the file permissions so that other programs like VS Code can write to the file.dont know how it occurred but it happened to me first day of 2024, find a solution that is pretty old school, in GitHub, =>. I cleared the folder "c:/Users/{user}/.vscode/extensions/" and reinstalled everything you want and everything works fine now… I am not gonna to lie, I was expecting a different solution, and it didn’t come from mcirosft.