Cursor Error: Cannot find module 'windows-foreground-love'

I’ve installed windows-foreground-love globally but cursor does not seem to be able to use it. Unsure how to resolve this?

[main 2024-08-02T15:46:01.168Z] Error: Cannot find module 'windows-foreground-love'
Require stack:
- C:\Users\chris\AppData\Local\Programs\cursor\resources\app\out\main.js
-
    at Module._resolveFilename (node:internal/modules/cjs/loader:1055:15)
    at s._resolveFilename (node:electron/js2c/browser_init:2:115690)
    at Module._load (node:internal/modules/cjs/loader:908:27)
    at c._load (node:electron/js2c/node_init:2:13672)
    at Module.require (node:internal/modules/cjs/loader:1122:19)
    at require (node:internal/modules/helpers:130:18)
    at a (C:\Users\chris\AppData\Local\Programs\cursor\resources\app\out\main.js:6:98)
    at l.load (C:\Users\chris\AppData\Local\Programs\cursor\resources\app\out\main.js:5:1640)
    at s.load (C:\Users\chris\AppData\Local\Programs\cursor\resources\app\out\main.js:4:13734)
    at f (C:\Users\chris\AppData\Local\Programs\cursor\resources\app\out\main.js:6:9338)
    at Object.errorback (C:\Users\chris\AppData\Local\Programs\cursor\resources\app\out\main.js:6:9457)
    at s.triggerErrorback (C:\Users\chris\AppData\Local\Programs\cursor\resources\app\out\main.js:4:14028)
    at C:\Users\chris\AppData\Local\Programs\cursor\resources\app\out\main.js:4:13779
    at l.load (C:\Users\chris\AppData\Local\Programs\cursor\resources\app\out\main.js:5:1657)
    at s.load (C:\Users\chris\AppData\Local\Programs\cursor\resources\app\out\main.js:4:13734)
    at f (C:\Users\chris\AppData\Local\Programs\cursor\resources\app\out\main.js:6:9338)
    at V._loadModule (C:\Users\chris\AppData\Local\Programs\cursor\resources\app\out\main.js:6:9466)
    at V._resolve (C:\Users\chris\AppData\Local\Programs\cursor\resources\app\out\main.js:7:452)
    at V.defineModule (C:\Users\chris\AppData\Local\Programs\cursor\resources\app\out\main.js:6:5561)
    at V._relativeRequire (C:\Users\chris\AppData\Local\Programs\cursor\resources\app\out\main.js:6:6185)
    at e (C:\Users\chris\AppData\Local\Programs\cursor\resources\app\out\main.js:6:8516)
    at C:\Users\chris\AppData\Local\Programs\cursor\resources\app\out\vs\code\electron-main\main.js:120:303
    at new Promise (<anonymous>)
    at ve.i (C:\Users\chris\AppData\Local\Programs\cursor\resources\app\out\vs\code\electron-main\main.js:120:281)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ve.f (C:\Users\chris\AppData\Local\Programs\cursor\resources\app\out\vs\code\electron-main\main.js:119:5310)
    at async C:\Users\chris\AppData\Local\Programs\cursor\resources\app\out\vs\code\electron-main\main.js:119:1385
    at async ve.a (C:\Users\chris\AppData\Local\Programs\cursor\resources\app\out\vs\code\electron-main\main.js:119:1272) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\chris\\AppData\\Local\\Programs\\cursor\\resources\\app\\out\\main.js',
    undefined
  ],
  phase: 'loading',
  moduleId: 'windows-foreground-love',
  neededBy: [ '===anonymous4===' ]
}

PS C:\Users\chris\Code\lofh> npm list -g windows-foreground-love
C:\Users\chris\AppData\Roaming\npm
└── windows-foreground-love@0.5.0

1 Like

I am having the same problem when opening a folder with cursor from the command line. The folder is opened and everything works fine though

I had the same error.

In my case, the error occurred when I opened the file from the command line, and Cursor did not come to the foreground.

The problem did not occur when I used VSCode.

e.g.: Cursor.exe --goto “test.cpp:100:10”

@chrisbheather How do you cause this error to appear?

@chrisbheather For me, switching Cursor’s terminal from powershell to bash did the trick. Hope this helps.