[BUG] EACCES Error with Windows 11 App Execution Aliases
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, nodejs
- Ambito
- cli, operating-systems
Direzione di ricerca
Start at node-which's which.sync path and its isexe dependency, then review the linked isexe PR and compare fs.statSync and fs.accessSync behavior on Windows 11 App Execution Aliases. Reproduce with the mspaint example; done means the alias is returned by which.sync and recognized by isexe.sync.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
The node-which module (and its dependency isexe) encounters EACCES: permission denied errors when checking Windows 11 App Execution Aliases like mspaint.exe located in %LOCALAPPDATA%\Microsoft\WindowsApps\.
Error: EACCES: permission denied, stat 'C:\Users\username\AppData\Local\Microsoft\WindowsApps\mspaint.exe'
at statSync (node:fs:1740:25)
at t.statSync (node:electron/js2c/node_init:2:5407)
Windows 11 App Execution Aliases are special files that:
- Appear as regular
.exefiles in directory listings - Can be executed normally from command line
- Cannot be accessed with
fs.stat()orfs.statSync()- these operations throwEACCESerrors - Can be checked for existence using
fs.access()
- The
whichmodule correctly returnsnullwhen using{ nothrow: true } - The
isexemodule correctly returnsfalsewhen using{ ignoreErrors: true } - Direct
fs.statSync()calls fail withEACCES fs.accessSync()works correctly on the same files
Expected Behavior
Since mspaint.exe is a valid executable in the user's PATH that can be launched successfully, the expected behavior should be:
which.sync('mspaint')should return the path to the executable:C:\Users\username\AppData\Local\Microsoft\WindowsApps\mspaint.exeisexe.sync(mspaintPath)should returntrue(indicating the file is executable)- App Execution Aliases should be treated as valid executables since they:
- Have executable file extensions (
.exe) - Are included in the system PATH
- Can be launched successfully from command line
- Are legitimate Windows applications
- Have executable file extensions (
Steps To Reproduce
- Windows 11 system
- Node.js installed
whichmodule installed (npm install which)- MS Paint available as App Execution Alias (default on Windows 11)
const which = require('which');
const result = which.sync('mspaint');
console.log('Found mspaint at:', result);
Environment
- npm: 11.4.2
- Node: 22.15.0
- OS: Windows 11
- platform: Win32
- Lingua principale
- JavaScript
- Stelle
- 352
- Fork
- 54
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di npm/node-which
-
Distribute esm versionAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
npm/node-which#174 · 2 commenti · 1 reazione ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
npm/node-which#133 · 1 commento ·
-
Needs Triage
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
npm/node-which#108 ·
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
npm/node-which#56 · 1 commento ·
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 32/100
npm/node-which#50 · 1 commento ·
Tutte le issue di npm/node-which
Issue simili
-
bug CI breakage triage needed
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
oppia/oppia#27517 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
draftomen enhancement size: S
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
andreagrandi/draftomen#761 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
HarperFast/harper#2866 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
HarperFast/harper-pro#927 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
anthropics/skills#1897 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno