0

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.

Mensur
  • 1,196
  • 3
  • 18
  • 30
  • Maybe [this](https://stackoverflow.com/questions/14469515/how-to-npm-install-to-a-specified-directory) will help you? – terahertz Aug 06 '19 at 13:32
  • Can you share your source code in github ? – Tony Ngo Aug 06 '19 at 14:28
  • 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. – Mensur Aug 06 '19 at 15:57

1 Answers1

-2

please try to delete 'rxjs' from package.json file