简体   繁体   English

Nuxt 部署错误:服务器资源不可用

[英]Nuxt deployment error: server resources are not available

To deploy our nuxt website in ssr mode we first build and unit test website in the bitbucket pipeline and if tests are green we copy build files from bitbucket servers to our production server and trigger start.为了在 ssr 模式下部署我们的 nuxt 网站,我们首先在 bitbucket 管道中构建和单元测试网站,如果测试是绿色的,我们将构建文件从 bitbucket 服务器复制到我们的生产服务器并触发启动。

The problem is that Nuxt documentation says nothing about which exact files are required on the server.问题是 Nuxt 文档没有说明服务器上需要哪些确切的文件。

currently we are using:目前我们正在使用:

.nuxt/  
server/  
static/  
nuxt.config.js 

Sometimes after adding functionality to the website, deployed version throws an error:有时在向网站添加功能后,部署的版本会引发错误:

Error: Server resources are not available!

At the same time local version works fine.同时本地版本工作正常。
Also running production server locally on the project works.在项目上本地运行生产服务器也有效。 Error kinda hints that some paths picked up incorrectly by nuxt.. but the directory structure is completely the same.错误有点暗示nuxt错误地选择了一些路径..但​​目录结构完全相同。

Any ideas why this happens and how to fix that?任何想法为什么会发生这种情况以及如何解决这个问题?

If errors also mentions, Please check "file path"/.nuxt/dist/server existence.如果错误也提到, Please check "file path"/.nuxt/dist/server existence. Then on the terminal然后在终端

cd .nuxt

check if 'dist' folder exists.检查“dist”文件夹是否存在。 If it does not exists,如果不存在,

go back and npm run build .回去npm run build this will generate the 'dist' folder for use.这将生成“dist”文件夹以供使用。

If Still facing the issue, try,如果仍然面临问题,请尝试,

npm install --save nuxt
npm install --save vue-server-renderer

尝试添加: dev: process.env.NODE_ENV === 'DEV'到 nuxt.config.js

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM