Error ng serve cannot read C: directory : Access is denied
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- angular, typescript
- Bereich
- build-system, cli
Rechercherichtung
Reproduziere den Fehler unter Windows, indem du im bereitgestellten Projekt npm install und anschließend npm run local ausführst, und vergleiche das Ergebnis mit einem Projekt, das mit ng new erstellt wurde. Beginne damit, nachzuverfolgen, wie ng serve und der Angular-Compiler die aufgelisteten SCSS-Dateien und die übergeordneten C:-Verzeichnisse auflösen. Als erledigt gilt die Aufgabe, wenn der Compiler innerhalb des Projektpfads bleibt und die Anwendung ohne Zugriffsfehler unter eingeschränkten Berechtigungen bereitstellt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Command
serve
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
15.2
Description
Angular access denied in C: //
Context
I built an angular app in my personal computer. This app launch a little dashboard so far.
I tried to clone it into my professional computer to have access to some feature. In this computer, I have limited privileges, which means no writings rights on C:.
When I ran npm install, everything went well.
But when I ran npm run start i got the following error
✘ [ERROR] Cannot read directory "../../../../../..": Access is denied. [plugin angular-compiler]
✘ [ERROR] Could not resolve "C:/Users/RGUENOUN/git/other/coreapp-dashboard-feat-register/coreapp-dashboard-feat-register/src/app/pages/registration/registration-form/price-form/price-form.component.scss" [plugin angular-compiler]
✘ [ERROR] Cannot read directory "../../../../../..": Access is denied. [plugin angular-compiler]
✘ [ERROR] Could not resolve "C:/Users/RGUENOUN/git/other/coreapp-dashboard-feat-register/coreapp-dashboard-feat-register/src/app/shared/components/step-bar/step-bar.component.scss" [plugin angular-compiler]
✘ [ERROR] Cannot read directory "../../../../../..": Access is denied. [plugin angular-compiler]
✘ [ERROR] Could not resolve "C:/Users/RGUENOUN/git/other/coreapp-dashboard-feat-register/coreapp-dashboard-feat-register/src/app/shared/components/toaster/toaster.component.scss" [plugin angular-compiler]
✘ [ERROR] Cannot read directory "../../../../../..": Access is denied.
Question
How to fix it ?
And most importantly, why Angular is trying to access on C:// instead of staying in his own folder ??
Other elements
Here is the package.json :
{
"name": "coreapp-saas-front",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"build-local": "ng build --configuration=local",
"build-dev": "ng build --configuration=development",
"local": "ng serve --configuration=local --open --port 5200",
"dev": "ng serve --configuration=development --open --port 5200",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"@angular/animations": "^18.2.0",
"@angular/common": "^18.2.0",
"@angular/compiler": "^18.2.0",
"@angular/core": "^18.2.0",
"@angular/forms": "^18.2.0",
"@angular/platform-browser": "^18.2.0",
"@angular/platform-browser-dynamic": "^18.2.0",
"@angular/router": "^18.2.0",
"@ng-bootstrap/ng-bootstrap": "^17.0.1",
"@popperjs/core": "^2.11.8",
"bootstrap": "^5.3.3",
"bootstrap-icons": "^1.11.3",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.14.10"
},
"devDependencies": {
"@angular-devkit/build-angular": "^18.2.4",
"@angular/cli": "^18.2.4",
"@angular/compiler-cli": "^18.2.0",
"@angular/localize": "^18.2.0",
"@types/jasmine": "~5.1.0",
"jasmine-core": "~5.2.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"typescript": "~5.5.2"
}
}
Other notes
This error also happen when create a project with ng new
Minimal Reproduction
- Unzip coreapp-dashboard-main.zip
- run
npm install - run
npm run local - The bug should be reproduced if you have limited access rights
Exception or Error
Your Environment
C:\Users\RGUENOUN\git\other\coreapp-dashboard-main\coreapp-dashboard-main>ng version
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 18.2.4
Node: 22.9.0
Package Manager: npm 10.8.3
OS: win32 x64
Angular: 18.2.4
... animations, cli, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1802.4
@angular-devkit/build-angular 18.2.4
@angular-devkit/core 18.2.4
@angular-devkit/schematics 18.2.4
@schematics/angular 18.2.4
rxjs 7.8.1
typescript 5.5.4
zone.js 0.14.10
Anything else relevant?
No response
- Vorherrschende Sprache
- TypeScript
- Sterne
- 27k
- Forks
- 11.8k
- Ø Merge
- 16 Std. 35 Min.
- Gemergte PRs (30 T.)
- 176
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus angular/angular-cli
-
area: @angular/build gemini-triaged
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
angular/angular-cli#33955 ·
-
area: @angular/cli gemini-triaged
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
angular/angular-cli#33055 · 1 Kommentar · 3 Reaktionen ·
-
unit-test: with --coverage, a setup file's hooks reach only the first spec file of each worker Offenarea: @angular/build gemini-triaged
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 72/100
angular/angular-cli#34137 ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34131 · 1 zugewiesene Person ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34130 · 1 zugewiesene Person ·
Alle Issues in angular/angular-cli
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
ontola/atomic-server#1625 ·
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
melgarafael/DeskcommCRM#1451 ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
-
bug via-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
-
bot:ai-assisted component:compact-js status:untriaged
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
midnightntwrk/midnight-sdk#403 ·