I host a domain on plesk server. It contain Nodejs V 12.4.0
, I am not using anything like express or so.. I Just create nuxt app using create-nuxt-app
in my pc using NodeJs V. 16
, then run command npm run build
, Then after I uploaded the files/folder(.nuxt, nuxt.config.js, static and package.json) on server to folder httpdoc/merostatus.com/(uploaded all files/folder here).
Setting on Nodejs in server:
Document Root : /httpdocs/merostatus.com/static
Application Mode : production
Application URL : http://merostatus.com
Application Root : /httpdocs/merostatus.com
Application Startup File : node_modules/nuxt/bin/nuxt.js
After this setting I click on NPM install button on Plesk and Restart App
But the output is not as desired. It is searching for pages folder, When I point Application Startup File to .nuxt/server.js It doesn’t found vue instance.
My server is on live just now for addressing issue
https://merostatus.com
2
Answers
I am currently using Plesk VPS server with OS Ubuntu 20.04
I solved the issue by making change in following ways
Step 1: Added nuxt-start module :
npm install --save nuxt-start
Step 2: Build the project :
npm run build
Step 3: Upload project to server including all dependencies (Whole project not only .nuxt)
Step 4: Changing Setting on Nodejs in server:
If you do have
target: server
(default), you indeed need tonpm run build
. The usual process is going through eithernpm run build
ornpm run generate
(iftarget: static
).Then, uploading only your
dist
directory is enough. No need for any other files. Then, runningnpm run start
(some platforms do this for you).I’m not sure about your Plesk server configuration but you can try to build your app and drop the dist directory at Netlify, at least to see if it builds there: https://app.netlify.com/drop
Then, if you achieve this, we could look for Plesk.