Phaser File Set Showing Errors On Trying To 'install npm' in the terminal

I am following a course on game development with Phaser and JavaScript and in the present project I am getting following error:

PS V:\Learning\phaser+physics\phaser physics> npm install
npm error code ENOENT
npm error syscall open
npm error path V:\Learning\phaser+physics\phaser physics\package.json
npm error errno -4058
npm error enoent Could not read package.json: Error: ENOENT: no such file or directory, open 'V:\Learning\phaser+physics\phaser physics\package.json'
npm error enoent This is related to npm not being able to find a file.
npm error enoent
npm error A complete log of this run can be found in: C:\Users\vivek\AppData\Local\npm-cache\_logs\2024-09-05T12_59_31_593Z-debug-0.log

But the other projects are working fine. You can find the project as a zip archive here:

I can provide them as code if needed. Can you guys tell me what’s going on?

npm install looks for a package.json file to install from, and it’s not finding one in V:\Learning\phaser+physics\phaser physics. You can run the command ls to list the contents of that folder.

the debug file says

21 error enoent Could not read package.json: Error: ENOENT: no such file or directory, open 'V:\Learning\phaser+physics\phaser physics\package.json

Is there anything i can do about it?

the ls command gives the following output

Directory: V:\Learning\phaser+physics\phaser physics


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----        05-09-2024     18:28                pwa
d-----        05-09-2024     18:28                src
d-----        05-09-2024     18:28                typings
d-----        05-09-2024     18:28                webpack
-a----        05-09-2024     18:29             93 package-lock.json

this is the contents of the package-lock.json file:

{
  "name": "phaser physics",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {}
}

This won’t help either, unfortunately. :frowning: They seem to have given you a bad project.

You can try this but I’m not sure it will work:

npm init -y
npm install phaser webpack

npx webpack serve

That did work, in fact, :slight_smile:

It worked to install npm but lead to another error in the run build command, truly a bad project provided with a course with decent instructions