Не удается развернуть сайт гэтсби на Netlify с помощью fontawesome pro

У меня есть статический сайт, созданный с помощью Gatstbyjs + contentful. Когда я пытаюсь собрать и развернуть его через Netlify, я сталкиваюсь с некоторыми странными проблемами.

Изучив свой код, я так и не смог найти для него исправления. Сборка отлично работает локально, и кажется, что проблема существует только тогда, когда я пытаюсь собрать ее через Netlify. Я предполагаю, что это связано с тем, что плагину FontAwesome Pro нужен токен доступа для доступа через NPM на Netlify? У меня есть плагин, настроенный с токеном доступа локально на моей машине, но я не знаю, как это сделать с Netlify. Означает ли это, что я должен полностью удалить этот плагин?

Вот журнал ошибок:

11:21:33 PM: Build ready to start
11:21:36 PM: build-image version: 9e0f207a27642d0115b1ca97cd5e8cebbe492f63
11:21:36 PM: build-image tag: v3.3.2
11:21:36 PM: buildbot version: ef8d0929ed0baabafd8bbb7d0b021e1fc24180c0
11:21:36 PM: Fetching cached dependencies
11:21:36 PM: Starting to download cache of 255.0KB
11:21:36 PM: Finished downloading cache in 86.678513ms
11:21:36 PM: Starting to extract cache
11:21:36 PM: Failed to fetch cache, continuing with build
11:21:36 PM: Starting to prepare the repo for build
11:21:37 PM: No cached dependencies found. Cloning fresh repo
11:21:37 PM: git clone https://github.com/sniperyork/theconcord
11:21:39 PM: Preparing Git Reference refs/heads/master
11:21:39 PM: Starting build script
11:21:39 PM: Installing dependencies
11:21:41 PM: Downloading and installing node v10.16.0...
11:21:41 PM: Downloading https://nodejs.org/dist/v10.16.0/node-v10.16.0-linux-x64.tar.xz...
11:21:41 PM: 
#################
11:21:41 PM:                      23.9%
11:21:42 PM: 
####################################################################
11:21:42 PM: #### 100.0%
11:21:42 PM: Computing checksum with sha256sum
11:21:42 PM: Checksums matched!
11:21:44 PM: Now using node v10.16.0 (npm v6.9.0)
11:21:45 PM: Attempting ruby version 2.6.2, read from environment
11:21:46 PM: Using ruby version 2.6.2
11:21:46 PM: Using PHP version 5.6
11:21:46 PM: Started restoring cached node modules
11:21:46 PM: Finished restoring cached node modules
11:21:47 PM: Installing NPM modules using NPM version 6.9.0
11:21:50 PM: npm
11:21:50 PM: WARN deprecated @babel/[email protected]: ? As of Babel 7.4.0, this
11:21:50 PM: npm WARN deprecated package has been deprecated in favor of directly
11:21:50 PM: npm WARN deprecated including core-js/stable (to polyfill ECMAScript
11:21:50 PM: npm WARN deprecated features) and regenerator-runtime/runtime
11:21:50 PM: npm WARN deprecated (needed to use transpiled generator functions):
11:21:50 PM: npm WARN deprecated
11:21:50 PM: npm WARN deprecated   > import "core-js/stable";
11:21:50 PM: npm
11:21:50 PM:  WARN deprecated   > import "regenerator-runtime/runtime";
11:21:56 PM: npm WARN deprecated [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
11:22:00 PM: npm WARN deprecated [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
11:22:00 PM: npm WARN deprecated [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
11:22:01 PM: npm WARN deprecated [email protected]: core-js@<2.6.8 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version of core-js@2.
11:22:08 PM: npm ERR! code E404
11:22:08 PM: npm ERR!
11:22:08 PM:  404 Not Found - GET https://registry.npmjs.org/@fortawesome%2fpro-light-svg-icons - Not found
11:22:08 PM: npm ERR!
11:22:08 PM: 404
11:22:08 PM: npm
11:22:08 PM:  ERR! 404  '@fortawesome/pro-light-svg-icons@^5.9.0' is not in the npm registry.
11:22:08 PM: npm ERR!
11:22:08 PM:  404 You should bug the author to publish it (or use the name yourself!)
11:22:08 PM: npm
11:22:08 PM:  ERR! 404 It was specified as a dependency of 'repo'
11:22:08 PM: npm ERR!
11:22:08 PM:  404
11:22:08 PM: npm ERR!
11:22:08 PM: failed during stage 'building site': Build script returned non-zero exit code: 1
11:22:08 PM: 404 Note that you can also install from a
11:22:08 PM: npm ERR!
11:22:08 PM:  404 tarball, folder, http url, or git url.
11:22:08 PM: npm
Поведение ключевого слова "this" в стрелочной функции в сравнении с нормальной функцией
Поведение ключевого слова "this" в стрелочной функции в сравнении с нормальной функцией
В JavaScript одним из самых запутанных понятий является поведение ключевого слова "this" в стрелочной и обычной функциях.
Концепция локализации и ее применение в приложениях React ⚡️
Концепция локализации и ее применение в приложениях React ⚡️
Локализация - это процесс адаптации приложения к различным языкам и культурным требованиям. Это позволяет пользователям получить опыт, соответствующий...
Навигация по приложениям React: Исчерпывающее руководство по React Router
Навигация по приложениям React: Исчерпывающее руководство по React Router
React Router стала незаменимой библиотекой для создания одностраничных приложений с навигацией в React. В этой статье блога мы подробно рассмотрим...
Массив зависимостей в React
Массив зависимостей в React
Все о массиве Dependency и его связи с useEffect.
1
0
939
1
Перейти к ответу Данный вопрос помечен как решенный

Ответы 1

Ответ принят как подходящий

Из документы вы должны создать файл .npmrc в корне вашего проекта (или там, где у вас есть файл package.json), содержащий:

@fortawesome:registry=https://npm.fontawesome.com/
//npm.fontawesome.com/:_authToken=TOKEN

затем установите последнюю версию библиотеки pro, используя пряжу или npm.

Затем вы, как обычно, импортируете их в app.js, и все готово.

Большое вам спасибо за вашу помощь!

York Wang 10.07.2019 22:32

Другие вопросы по теме