首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Vuepress部署到Netfly失败

Vuepress部署到Netfly失败
EN

Stack Overflow用户
提问于 2020-01-15 11:08:40
回答 1查看 758关注 0票数 0

严格按照这里的文档构建https://v1.vuepress.vuejs.org/guide/deploy.html#netlify,但每次构建都会失败。Site在开发上表现出色,但每次部署构建都会失败。

代码库:https://github.com/MagicGary/DouglasCourses

package.json中的站点设置:

代码语言:javascript
复制
{
    "scripts": {
        "docs:dev": "vuepress dev docs",
        "docs:build": "vuepress build docs"
    }
}

Netfly部署设置

代码语言:javascript
复制
Build Command: yarn docs:build or npm run docs:build
Publish directory: docs/.vuepress/dist

它说6:48:31 PM: sh: 1: vuepress: not found,我刚开始部署它们,我想它是在抱怨vuepress没有安装在生产服务器环境中,但我所做的一切都是严格按照文档操作。文档中没有提到部署部分中的任何其他内容,除此之外,

我是不是在项目的config.js中遗漏了什么?

Netfly部署错误日志

代码语言:javascript
复制
6:48:30 PM: Executing user command: npm run docs:build
6:48:31 PM: > @ docs:build /opt/build/repo
6:48:31 PM: > vuepress build docs
6:48:31 PM: sh: 1: vuepress: not found
6:48:31 PM: npm ERR!
6:48:31 PM:  code ELIFECYCLE
6:48:31 PM: npm
6:48:31 PM:  ERR! syscall spawn
6:48:31 PM: npm
6:48:31 PM: ERR!
6:48:31 PM: file sh
6:48:31 PM: npm
6:48:31 PM:  ERR! errno ENOENT
6:48:31 PM: npm ERR! @ docs:build: `vuepress build docs`
6:48:31 PM: npm ERR! spawn ENOENT
6:48:31 PM: npm
6:48:31 PM:  ERR!
6:48:31 PM: npm
6:48:31 PM:  ERR!
6:48:31 PM:  Failed at the @ docs:build script.
6:48:31 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
6:48:31 PM: npm
6:48:31 PM:  ERR! A complete log of this run can be found in:
6:48:31 PM: npm ERR!     /opt/buildhome/.npm/_logs/2020-01-15T02_48_31_298Z-debug.log
6:48:31 PM: Skipping functions preparation step: no functions directory set
6:48:31 PM: Caching artifacts
6:48:31 PM: Started saving node modules
6:48:31 PM: Finished saving node modules
6:48:31 PM: Started saving pip cache
6:48:31 PM: Finished saving pip cache
6:48:31 PM: Started saving emacs cask dependencies
6:48:31 PM: Finished saving emacs cask dependencies
6:48:31 PM: Started saving maven dependencies
6:48:31 PM: Finished saving maven dependencies
6:48:31 PM: Started saving boot dependencies
6:48:31 PM: Finished saving boot dependencies
6:48:31 PM: Started saving go dependencies
6:48:31 PM: Finished saving go dependencies
6:48:33 PM: Error running command: Build script returned non-zero exit code: 1
6:48:33 PM: Failing build: Failed to build site
6:48:33 PM: failed during stage 'building site': Build script returned non-zero exit code: 1
6:48:34 PM: Finished processing build request in 14.167417237s
EN

回答 1

Stack Overflow用户

发布于 2020-01-15 11:31:17

根据您发送的链接上的文档,您必须将vuepress安装为本地依赖项

代码语言:javascript
复制
You are placing your docs inside the docs directory of your project;
You are using the default build output location (.vuepress/dist);
VuePress is installed as a local dependency in your project, and you have setup the following npm

您可以使用以下链接(也提到netlify)遵循官方文档,了解如何将vuepress添加为本地依赖项

https://v1.vuepress.vuejs.org/guide/getting-started.html#inside-an-existing-project

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59744648

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档