Я новичок в использовании git, и у меня проблемы с нажатием.
У меня есть приложение Heroku, на котором я практикуюсь.Я установил Heroku CLI, и вот что я пытаюсь сделать:
heroku login
// успешно
heroku git:clone -a myapp
// успешно, но с предупреждением, что я клонировал пустой репозиторий,Как я понимаю, это нормально?
Затем я создаю файл readme.txt
в папке.Это должно быть в папке /myapp
или в папке /myapp/.git
?
Когда я делаю git add readme.txt
в папке myapp
, терминал не выдает никаких ошибок или сообщений об успехе
Тогда я делаю git commit -am "add readme"
// Кажется успешным
Затем я делаю git push heroku master
// Fails
Ошибка, которую я получаю, когда нажимаю:
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 471 bytes | 471.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/nodejs.tgz
remote:
remote: ! ERROR: Application not supported by 'heroku/nodejs' buildpack
remote: !
remote: ! The 'heroku/nodejs' buildpack is set on this application, but wa
remote: ! unable to detect a Node.js codebase.
remote: !
remote: ! A Node.js app on Heroku requires a 'package.json' at the root of
remote: ! the directory structure.
remote: !
remote: ! If you are trying to deploy a Node.js application, ensure that this
remote: ! file is present at the top level directory. This directory has the
remote: ! following files:
remote: !
remote: ! readme.txt
remote: !
remote: ! If you are trying to deploy an application written in another
remote: ! language, you need to change the list of buildpacks set on your
remote: ! Heroku app using the 'heroku buildpacks' command.
remote: !
remote: ! For more information, refer to the following documentation:
remote: ! https://devcenter.heroku.com/articles/buildpacks
remote: ! https://devcenter.heroku.com/articles/nodejs-support#activation
remote:
remote:
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to myapp.
remote:
To https://git.heroku.com/myapp.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/myapp.git'
Где это происходит?
РЕДАКТИРОВАТЬ
package.json
{
"name": "myapp",
"version": "1.0.0",
"description": "lamwork",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"example",
"heroku"
],
"author": "My Name",
"license": "ISC"
},
"engines": {
"node": "10.15.0"
}
}
После фиксации package.json Я получаю эту ошибку при попытке нажать:
Counting objects: 8, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (8/8), 1.03 KiB | 528.00 KiB/s, done.
Total 8 (delta 1), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote: parse error: Expected value before ',' at line 15, column 2
remote: ! Unable to parse package.json
remote:
remote:
remote: -----> Change to Node.js build process
remote: Heroku has begun executing the "build" script defined in package.json
remote: during Node.js builds.
remote:
remote: Read more: https://devcenter.heroku.com/changelog-items/1573
remote:
remote:
remote: -----> Build failed
remote:
remote: We're sorry this build is failing! You can troubleshoot common issues here:
remote: https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:
remote: If you're stuck, please submit a ticket so we can help:
remote: https://help.heroku.com/
remote:
remote: Love,
remote: Heroku
remote:
remote: ! Push rejected, failed to compile Node.js app.
remote:
remote: ! Push failed
remote: Verifying deploy....
remote:
remote: ! Push rejected to myapp.
remote:
To https://git.heroku.com/myapp.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/myapp.git'