-1

I have a problem with npm, but specifically when starting my project for a simple server using node.js.

hello network

I have a problem with npm, but specifically when starting my project for a simple server using node.js. I tried to search in forums, videos and articles but the solutions didn't answer me.

The ERROR says that the package.json file is not in the directory, but it is - and the file contains "start" directing to the nodemon app.js command.

My directory Error npm

Thank you very much

  • "The ERROR says that the package.json file is not in the directory" - The screenshot you provided does not mention *package.json* at all. – Quentin Jan 02 '23 at 17:31
  • 1
    Please see the [How to Ask](https://stackoverflow.com/help/how-to-ask) page. [Please post text, not links to images of text.](https://meta.stackoverflow.com/questions/285551/why-should-i-not-upload-images-of-code-data-errors-when-asking-a-question/285557#285557). Questions should stand on their own. We can't see your package.json, the error doesn't say `package.json is not in the directory`, etc. Did you look at the log file the error says to look at? – Dave Newton Jan 02 '23 at 17:31

1 Answers1

1

The error says that cmd.exe; is not found (and not, as you claim, package.json). Note the extra ; at the end which shouldn't be there.

Make sure your system's COMSPEC environment variable doesn't have this spurious semicolon at the end (if it has, remove it and restart your computer) and also that you don't have any .npmrc that overrides the shell with the bad path.

CherryDT
  • 25,571
  • 5
  • 49
  • 74