Frontend & backend - cannot find package.json

Hi,

I am trying to deploy the front-end of my project, but it can’t seem to find the package.json file. I am trying to deploy it as a static site. I have the root directory as “client”, and the build command as “npm install; npm run-script build;”, and the publish directory as “build”. Here is my project structure:

And here is the error:

npm ERR! code ENOENT

May 21 07:34:23 PMnpm ERR! syscall open

May 21 07:34:23 PMnpm ERR! path /opt/render/project/src/client/package.json

May 21 07:34:23 PMnpm ERR! errno -2

May 21 07:34:23 PMnpm ERR! enoent Could not read package.json: Error: ENOENT: no such file or directory, open ‘/opt/render/project/src/client/package.json’

May 21 07:34:23 PMnpm ERR! enoent This is related to npm not being able to find a file.

May 21 07:34:23 PMnpm ERR! enoent

May 21 07:34:23 PM

May 21 07:34:23 PMnpm ERR! A complete log of this run can be found in: /opt/render/.cache/_logs/2024-05-22T02_34_23_002Z-debug-0.log

May 21 07:34:23 PMnpm ERR! code ENOENT

May 21 07:34:23 PMnpm ERR! syscall open

May 21 07:34:23 PMnpm ERR! path /opt/render/project/src/client/package.json

May 21 07:34:23 PMnpm ERR! errno -2

May 21 07:34:23 PMnpm ERR! enoent Could not read package.json: Error: ENOENT: no such file or directory, open ‘/opt/render/project/src/client/package.json’

May 21 07:34:23 PMnpm ERR! enoent This is related to npm not being able to find a file.

May 21 07:34:23 PMnpm ERR! enoent

May 21 07:34:23 PM

May 21 07:34:23 PMnpm ERR! A complete log of this run can be found in: /opt/render/.cache/_logs/2024-05-22T02_34_23_653Z-debug-0.log

Would love to get some help on this. Thanks!

Hi there,

Please double-check that you have committed and pushed these files to GitHub.

Regards,

Keith
Render Support, UTC+10 :australia:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.