Vuejs web app deployement fails

Hi dear render community,

I am trying to deploy a vue app without success.
The application is build and serve properly localy.

When trying to deploy it on render, the build is done properly but NPM RUN SERVE fails.
It seems that the file package.json is not found properly even if this file is at the root of the app…

Do you have an idea of the root cause of the issue?

May 31 08:15:23 AM ==> It looks like we don’t have access to your repo, but we’ll try to clone it anyway.
May 31 08:15:23 AM ==> Cloning from GitHub - nicolas-wd-developpement/strapi-render-front
May 31 08:15:24 AM ==> Checking out commit 0ea96743aa0c61d144950fd26bfe7b0b0993d908 in branch front
May 31 08:15:27 AM ==> Downloading cache…
May 31 08:15:35 AM ==> Downloaded 237KB in 5s. Extraction took 0s.
May 31 08:15:41 AM ==> Running build command ‘npm install && npm build’…
May 31 08:15:43 AM audited 27 packages in 0.558s
May 31 08:15:43 AM found 0 vulnerabilities
May 31 08:15:43 AM
May 31 08:15:43 AM ==> Generating container image from build. This may take a few minutes…
May 31 08:19:24 AM ==> Uploading build…
May 31 08:20:29 AM ==> Build successful :tada:
May 31 08:20:29 AM ==> Deploying…
May 31 08:20:39 AM ==> Starting service with ‘npm run serve’
May 31 08:20:40 AM npm ERR! code ENOENT
May 31 08:20:40 AM npm ERR! syscall open
May 31 08:20:40 AM npm ERR! path /opt/render/project/src/package.json
May 31 08:20:40 AM npm ERR! errno -2
May 31 08:20:41 AM npm ERR! enoent ENOENT: no such file or directory, open ‘/opt/render/project/src/package.json’
May 31 08:20:41 AM npm ERR! enoent This is related to npm not being able to find a file.
May 31 08:20:41 AM npm ERR! enoent
May 31 08:20:41 AM
May 31 08:20:41 AM npm ERR! A complete log of this run can be found in:
May 31 08:20:41 AM npm ERR! /opt/render/.cache/_logs/2022-05-31T06_20_41_001Z-debug.log
May 31 08:20:48 AM ==> Starting service with ‘npm run serve’
May 31 08:20:50 AM npm ERR! code ENOENT
May 31 08:20:50 AM npm ERR! syscall open
May 31 08:20:50 AM npm ERR! path /opt/render/project/src/package.json
May 31 08:20:50 AM npm ERR! errno -2
May 31 08:20:50 AM npm ERR! enoent ENOENT: no such file or directory, open ‘/opt/render/project/src/package.json’
May 31 08:20:50 AM npm ERR! enoent This is related to npm not being able to find a file.

By the looks of your repo GitHub - nicolas-wd-developpement/strapi-render-front you don’t have a package.json file.

You can run the command npm init in a terminal on your computer and follow the instructions it gives you if you need to create one.

It also looks like you’re perhaps running a build command npm run serve in the Render service. This will have to be added in the scripts section of your package.json file.

Hope that helps

Also, just to add to what Mike said there - it might also be worth checking your .gitignore to see if you’re ignoring package.json which is preventing it from being deployed to us,

John B

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