Приложение Node.js на Heroku требует «package.json» в корне структуры каталогов - PullRequest
0 голосов
/ 03 июля 2019

Я пытаюсь загрузить свой API в сеть, и я слышал, что 'Heroku' - хорошая бесплатная облачная платформа.У меня есть есть package.json: the root folder

Журнал сборки:

-----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/nodejs.tgz

 !     ERROR: Application not supported by 'heroku/nodejs' buildpack
 !     
 !     The 'heroku/nodejs' buildpack is set on this application, but was
 !     unable to detect a Node.js codebase.
 !         
 !     A Node.js app on Heroku requires a 'package.json' at the root of
 !     the directory structure.
 !     
 !     If you are trying to deploy a Node.js application, ensure that this
 !     file is present at the top level directory. This directory has the
 !     following files:
 !     
 !     Bezeq.js
 !     Cellcom.js
 !     Hot.js
 !     MainAPI.js
 !     node_modules/
 !     package-lock.json
 !     Partner.js
 !         
 !     If you are trying to deploy an application written in another
 !     language, you need to change the list of buildpacks set on your
 !     Heroku app using the 'heroku buildpacks' command.
 !         
 !     For more information, refer to the following documentation:
 !     https://devcenter.heroku.com/articles/buildpacks
 !     https://devcenter.heroku.com/articles/nodejs-support#activation
       More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
 !     Push failed

Почему это не работает?
Спасибо

Ответы [ 2 ]

0 голосов
/ 04 июля 2019

Я исправил проблему, как и ожидалось, в файле package.json.Я запустил 'npm init', но на этот раз более внимательно и заметил мелкие детали.После этого я снова попытался развернуть, и это сработало.Спасибо Али за направление

0 голосов
/ 03 июля 2019

Запустили ли вы «npm init» в корне вашего проекта для создания package.json?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...