When running an ASP.NET Core 2.2 + Angular web app it fails to start because it appears to be looking for the package.json
file in the wrong location. Project was created from a Visual Studio template.
Microsoft.AspNetCore.SpaServices:Error: npm ERR! path C:\Windows\System32\package.json
Microsoft.AspNetCore.SpaServices:Error: npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Windows\System32\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
I cannot figure out why the app is looking for the package.json
in the System32
folder.
EDIT:
I just created a brand new angular project with dotnet angular -o angular-app
and running it causes the issue. So this must be something with my node/npm setup but I cannot figure out what could be causing it to look in System32
directory. It is interesting that going to ClientApp
directory and running ng serve
works fine.