简体   繁体   中英

Debug dotnet core Angular Template in IIS EPERM error

I have 2 test dotnet core 3.1 test apps. One uses an Angular 8 template and another uses the angular 9 and both are running in visual studios 2019 admin mode and both give me the same EPERM error below when running it in IIS (works in iis express)

Because I am running these with windows auth, I am needing to run it through IIS and not IIS Express since IIS Express eternally asks for my credentials instead of logging me in. (also I don't have access to updating my trusted sites (I read this could fix that))

I have visual studio creating the IIS Sites, but when I run it in Development environment I receive long error message at the bottom. If I try it in Production environment I get Page isn't working (500 error).

Things I've Tried

  1. I've moved my npm out of %appdata%/roaming into a folder that avoids the firewall because I read it could be the issue
  2. I am the owner of npm and npm-cache
  3. I have cleaned the cache and restarted
  4. Updated npm to 6.14.5
  5. Node is 12.6.1
  6. Restarted machine

Question

Has anyone ran into this before & have they been able to fix it? I'm just wanting to debug my dotnet angular app in visual studio

Error

'C:\WINDOWS\system32\config\systemprofile\AppData\Roaming\npm'

AggregateException: One or more errors occurred. (One or more errors occurred. (The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: Error: EPERM: operation not permitted, mkdir 'C:\WINDOWS\system32\config\systemprofile\AppData\Roaming\npm'

TypeError: Cannot read property 'get' of undefined

at errorMessage (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-message.js:38:39)
at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:201:13)
at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:78:20
at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:225:22)
at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:263:24
at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:81:7
at Array.forEach (<anonymous>)
at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:80:13
at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25)
at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:171:20)
C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:97
var doExit = npm.config.loaded ? npm.config.get('_exit') : true

Try to add below code in web.config file:

<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Production" />

to debug iis site you could try to use remote debugging.

https://docs.microsoft.com/en-us/visualstudio/debugger/remote-debugging-aspnet-on-a-remote-iis-computer?view=vs-2019

https://stackoverflow.com/a/61769794/11147346

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM