Recently, I completed a project and uploaded it to Github. The issue arises when I attempt to clone it to my live server - only about 1 out of 10 times does everything function correctly after running npm run build
. My setup consists of Ubuntu 16 with nginx and simple webpack integrated with Vue. Additionally, the latest versions of node and npm are installed on my server.
Interestingly, no errors or warnings are displayed during this process. Although executing the command seemingly creates the necessary build.js and build map files, there are instances where nothing is shown except for an indication that the system is optimizing without yielding any tangible results.
By "sometimes working," I mean that performing the command npm run build
eight consecutive times (without modifying any code) eventually leads to successful execution.
As someone relatively new to JavaScript tools, I perceive npm run build
as being responsible for constructing my project and generating a build.js file intended for deployment on the live server, while npm run dev
serves the purpose of local hosting.
If anyone has insights into what the underlying problem might be, your guidance would be greatly appreciated.
The following is an excerpt from my package.json:
{
"name": "front",
"description": "A Vue.js project",
"version": "1.0.0",
...
}
I am uncertain whether this detail is pertinent, but here is how my nginx block configuration looks:
server {
listen 80;
listen [::]:80;
root /var/www/my_project/html;
index index.php index.html index.htm index.nginx-debian.html;
server_name my_project.com www.my_project.com
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}