0

I'm using nodemon to monitor my file changes. I have a custom script in my package.json script section as follows:

  "scripts": {
    "start": "nodemon --ignore htm,html --ext cs,js --exec \"dotnet run --debug\" -V"
  }

which I run by opening a command prompt at the same location as my package.json file and running npm run start. When I run that command, I get the following error:

The current project is not valid because of the folloding errors:
C:\<1,0>: error: DOTNET1017: Project file does not exist 'C:\project.json'.
[nodemon] app crashed - waiting for file changes before starting...

I'm not sure why it is looking in the C drive. This started happening when I started using a new development computer - my old dev machine never had this issue. I've checked my node, npm, and nodemon versions between both computers and they are exactly the same.

Roka545
  • 3,404
  • 20
  • 62
  • 106

2 Answers2

1

You should specify the current project entry point in the command (or ./ if the defaults work):

"scripts": {
    "start": "nodemon --ignore htm,html --ext cs,js --exec \"dotnet run --debug\" -V ./server.js"
  }
Paul
  • 35,689
  • 11
  • 93
  • 122
0

To resolve this issue, see this SO post (turns out there was a registry value that changed the current working directory) : npm always using home directory as current working directory

Community
  • 1
  • 1
Roka545
  • 3,404
  • 20
  • 62
  • 106