Не удалось развернуть Vuepress в Netfly - PullRequest
0 голосов
/ 15 января 2020

Строго следуйте документации, приведенной здесь https://v1.vuepress.vuejs.org/guide/deploy.html#netlify, но сборка не выполняется каждый раз. Сайт работает на развитие, но каждая сборка развертывания продолжает давать сбои.

База кода: https://github.com/MagicGary/DouglasCourses

Настройка сайта в package.json:

{
    "scripts": {
        "docs:dev": "vuepress dev docs",
        "docs:build": "vuepress build docs"
    }
}

Настройка развертывания Netfly

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 не установлен в среде производственного сервера, но все, что я делал, строго следовал документации. В документации не упоминается ничего другого в разделе развертывания, кроме этого,

enter image description here

Я что-то пропустил в config.js моего проекта?

Журнал ошибок развертывания Netfly

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

1 Ответ

0 голосов
/ 15 января 2020

согласно документации по отправленной вами ссылке, вы должны установить vuepress как локальную зависимость

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

Вы можете следовать официальной документации о том, как добавить vuepress как локальную зависимость, используя следующую ссылку ( который также упоминает netlify)

https://v1.vuepress.vuejs.org/guide/getting-started.html#inside -an-существующий-проект

...