skip to Main Content

My working project is located here: DocumentsCoursReactcarsAppcars.

When I run:

cd cars
npm start

I encounter a bunch of problems like:

npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:UserssecuhOneDriveDocuments/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory,open ‘C:UserssecuhOneDriveDocumentspackage.json’
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:UserssecuhAppDataLocalnpm-cache_logs2023-12-10T11_45_40_444Z-debug-0.log

The VS Code terminal is looking for package.json in the Documents directory. package.json is in cars directory

However, when I run:

PS C:UserssecuhOneDriveDocumentsCoursReactcarsApp> cd cars
PS C:UserssecuhOneDriveDocumentsCoursReactcarsAppcars> npm start

in the Windows terminal, it works perfectly without any errors, and the page launches. On my other PC, this same process works flawlessly in the VS Code terminal.

Does anyone have a suggestion?

2

Answers


  1. You will need to add a semi colon between commands like this:

    cd path; npm start;
    
    Login or Signup to reply.
  2. Check Node.js Installation:
    Ensure that Node.js is installed on your system, and the path to the Node.js executable is added to your system’s PATH variable.

    Restart VS Code:
    Close and reopen VS Code to make sure any changes to your system’s PATH variable are recognized.

    Reload the Terminal:
    If you’ve made changes to your environment variables, you might need to restart or reload the integrated terminal in VS Code for the changes to take effect.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search