getcursor / cursor

The AI Code Editor
https://cursor.com
22.83k stars 1.46k forks source link

Can't open Cursor (Latest Version) #1007

Open CarstonGowans opened 10 months ago

CarstonGowans commented 10 months ago

1) No Screenshot, as I'm unable to open the IDE in general. 2) Windows 10 V.21H2 (Lenovo ThinkPad)

Steps to recreate the issue

  1. Download the latest Windows .exe installer from the website
  2. Run the installer
  3. Restart the device
  4. Click on the Cursor shortcut to the application
  5. Note that the IDE has not opened.

In general, I'm unable to install and launch Cursor on my current work device. It's working perfectly fine on my personal device, however, it does not open even with a fresh, clean install or reinstall.

sualehasif commented 10 months ago

Thanks so much for reporting this. Do you see any logs (if you click open console in the cursor mmeus on the top right.) Do you see any errors?

sualehasif commented 10 months ago

We would love your help finding this issue so we can fix it ASAP!

CarstonGowans commented 10 months ago

@sualehasif I literally cannot open the IDE in general. I haven o method of retrieving the logs from the application itself.

truell20 commented 10 months ago

Could you send us a zip of the logs from %AppData%\Local\Programs\Cursor\logs and %AppData%\Roaming\Cursor\logs to hi@cursor.sh. This would be a massive help. The actual paths might differ a little bit.

CarstonGowans commented 10 months ago

Yes I can, give me a bit to do so.

CarstonGowans commented 10 months ago

Sent the zipped logs. It definitely looks like an issue with trying to edit the Registry.

truell20 commented 10 months ago

Appreciate it!

That said, where did you send them or with what title? Don't see them.

CarstonGowans commented 10 months ago

No worries @truell20,

I sent the email again to hi@cursor.sh again. Let me know if you got it this time.

pavan-gaikwad commented 6 months ago

I was trying to pitch it at work and it just won't open. Fails with a registry error.

ajay-dv8 commented 6 months ago

I downloaded cursor used it, turned of my laptop, tried to open it again and it wont work how do i fix it

harshithr commented 3 months ago

It's the same for me as well. Unable to open Cursor IDE on windows 10 22H2

Bhartendu-Kumar commented 1 month ago

I think I issue is that as cursor is trying to send crash reports,etc to its developers, so it needs to access QUERY HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography

But many company policies allow not to read it.

Is there some way to maybe remove some sender file or have a version that doesn't send to developers, in that case it will work

see similar issues for other softwares and its amendable.

https://github.com/strapi/strapi/issues/3219

@truell20

Bhartendu-Kumar commented 1 month ago

SOLVED:

QUICK - FIX:

Apparently VScode opens but not cursor. So i replaced the faulty script in cursor by the corresponding one in vscode.

Step1: Delete the directory: AppData\Local\Programs\cursor\resources\app\out\vs\code\electron-main Step2: Copy the directory: AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\electron-main Step3: Paste the copied directory at AppData\Local\Programs\cursor\resources\app\out\vs\code

And viola it runs!

@truell20 @CarstonGowans @sualehasif

Bhartendu-Kumar commented 1 month ago

LONG FIX:

In the script : AppData\Local\Programs\cursor\resources\app\out\vs\code\electron-main\main.js

there is a line of code for: async function u($){if(l.$i){const k=await new Promise((a,t)=>{X(["@vscode/windows-registry"],a,t)});try{return k.GetStringRegKey("HKEY_LOCAL_MACHINE",g,"MachineId")||""}catch(a){return $(a),""}}return""}}),define(ce[21],le([0,1,44,27,159,8,31,72,9,4,19,7]),function(X,e,i,D,E,A,I,S,l,h,b,w){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Promises=e.SymlinkSupport=e.RimRafMode=void 0,e.rimrafSync=p,e.readdirSync=$,e.whenDeleted=t,e.configureFlushOnWrite=c,e.writeFileSync=P;var v;

Which is the culprit, specifically the query k.GetStringRegKey("HKEY_LOCAL_MACHINE",g,"MachineId")

so one can see how it's handled in the vscode script

AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\electron-main\main.js

and just change that and it should run.

I did try but still, it was not fixed and already i could run my cursor so I didn't dig deep. But anticipate someone can and then that be the safer trick.

Thanks

Bhartendu-Kumar commented 1 month ago

As an afterthought, it might be the case that vscode might use the same script in \resources\app\out\vs\code\electron-main\main.js as cursor. But my vscode is not updated but cursor is latest version so I got benefitted by having an older version of vscode.

Nonetheless, the fix still works in that case download an older version of vscode that works and do it. Else download an older version of cursor that might work.

deployment-ian commented 2 weeks ago

I am having the same issue as OP and I tried the solution @Bhartendu-Kumar offered, but it did not work. It's bizarre as I can use VS code without issue.

Al4ric commented 2 weeks ago

Shame it cannot run same as VS Code. It should require same permissions. Currently it is not able to run it because: 2024-08-26 12:05:54.397 [error] Error: Command failed: %windir%\System32\REG.exe QUERY HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography /v MachineGuid ERROR: Registry editing has been disabled by your administrator.

at checkExecSyncError (node:child_process:905:11)
at execSync (node:child_process:977:15)
at node:electron/js2c/node_init:2:13035
Gadoes commented 1 week ago

@Bhartendu-Kumar's fix unfortunately does not work on my setup. I bypassed the registry error by running cursor as admin within a cmd window. However launch fails with code 18. Here are the logs from the admin cmd window :

C:\Users\a034194-dev\AppData\Local\Programs\cursor> [3752:0826/180426.323:ERROR:os_crypt_win.cc(68)] Failed to encrypt: L’opération requise ne peut pas être terminée. L’ordinateur doit être approuvé pour la délégation et le compte d’utilisateur actuel doit être configuré afin d’autoriser la délégation. (0x80090345) [main 2024-08-26T16:04:26.749Z] update#setState disabled [main 2024-08-26T16:04:26.751Z] update#ctor - updates are disabled as there is no update URL [main 2024-08-26T16:04:26.788Z] CodeWindow: renderer process gone (reason: launch-failed, code: 18) [main 2024-08-26T16:04:26.844Z] [storage state.vscdb] error checking size of src.vs.platform.reactivestorage.browser.reactiveStorageServiceImpl.persistentStorage.workspaceUser: Error: Unexpected number of rows - 0 [main 2024-08-26T16:04:26.844Z] [storage state.vscdb] error checking size of workbench.panel.aichat.view.aichat.chatdata: Error: Unexpected number of rows - 0 [main 2024-08-26T16:04:26.871Z] CodeWindow: renderer process gone (reason: launch-failed, code: 18) [main 2024-08-26T16:04:26.876Z] [uncaught exception in main]: Error: SQLITE_CANTOPEN: unable to open database file [main 2024-08-26T16:04:26.877Z] Error: SQLITE_CANTOPEN: unable to open database file

omrastogi commented 1 week ago

Hi, I am not able to open the cursor and this is the log:

2024-08-12 22:30:27.710 [error] Error: spawnSync C:\WINDOWS\system32\cmd.exe; C:\Users\Vijay Rastogi\AppData\Roaming\Python\Python311\Scripts ENOENT
    at Object.spawnSync (node:internal/child_process:1124:20)
    at spawnSync (node:child_process:891:24)
    at execSync (node:child_process:972:15)
    at node:electron/js2c/node_init:2:13035
    at y (C:\Users\Vijay Rastogi\AppData\Local\Programs\cursor\resources\app\out\vs\code\electron-main\main.js:46:402)
    at C:\Users\Vijay Rastogi\AppData\Local\Programs\cursor\resources\app\out\vs\code\electron-main\main.js:45:6588
    at g (C:\Users\Vijay Rastogi\AppData\Local\Programs\cursor\resources\app\out\vs\code\electron-main\main.js:45:6603)
    at R (C:\Users\Vijay Rastogi\AppData\Local\Programs\cursor\resources\app\out\vs\code\electron-main\main.js:106:1355)
    at S (C:\Users\Vijay Rastogi\AppData\Local\Programs\cursor\resources\app\out\vs\code\electron-main\main.js:106:1783)
    at vt.startup (C:\Users\Vijay Rastogi\AppData\Local\Programs\cursor\resources\app\out\vs\code\electron-main\main.js:117:58644)
    at C:\Users\Vijay Rastogi\AppData\Local\Programs\cursor\resources\app\out\vs\code\electron-main\main.js:119:1799
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ve.a (C:\Users\Vijay Rastogi\AppData\Local\Programs\cursor\resources\app\out\vs\code\electron-main\main.js:119:1272)

Unfortunately, @Bhartendu-Kumar solution didn't work for me.

ociule commented 1 week ago

SOLVED:

QUICK - FIX:

Apparently VScode opens but not cursor. So i replaced the faulty script in cursor by the corresponding one in vscode.

Step1: Delete the directory: AppData\Local\Programs\cursor\resources\app\out\vs\code\electron-main Step2: Copy the directory: AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\electron-main Step3: Paste the copied directory at AppData\Local\Programs\cursor\resources\app\out\vs\code

And viola it runs!

@truell20 @CarstonGowans @sualehasif

This worked for me on Win 10 Enterprise

Thanks!

Al4ric commented 1 week ago

For me it is not working. I no longer even see any logs. Tried running as Admin - nothing. Not in "AppData\Roaming\Cursor\logs" and nothing in Event Viewer.