Tôi biết câu hỏi này đã được hỏi nhiều lần. Nhưng tôi không thể dừng bản thân mình để đăng bài này ở đây. Tôi nooby. Tôi đang cố gắng đẩy ứng dụng từ git sang heroku bằng cách sử dụng lệnh sauĐẩy bị từ chối, không có ứng dụng hỗ trợ Cedar nào được phát hiện
[email protected]:~/vexxx$ git push heroku master
Tôi nhận được lỗi sau.
Counting objects: 8, done.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (8/8), 1015 bytes, done.
Total 8 (delta 0), reused 0 (delta 0)
! Push rejected, no Cedar-supported app detected
To [email protected]:fast-fortress-3889.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:fast-fortress-3889.git'
Tôi cố gắng để sử dụng Node.js khuôn khổ
CẬP NHẬT
Tôi có hai tập tin trong tên thư mục ứng dụng của tôi vxxxx/
1.README.md
2.venkat1.js
Ins ide venkat1.js
#!/usr/bin/env node
var fs = require('fs');
var outfile = "hello.txt";
var out = "A startup is a business built to grow rapidly.\n";
fs.writeFileSync(outfile, out);
console.log("Script: " + __filename + "\nWrote: " + out + "To: " + outfile);
Tôi không có bất kỳ tệp nào khác. Trên thực tế hai tệp này nằm trong repo git của tôi. Tôi cố gắng để đẩy nó vào Heroku và chạy các ứng dụng có sử dụng Node.js
Cập nhật 2:
Yes. Tôi có tệp package.JSON
{
"name": "vxxxxx",
"version": "0.0.2",
"description": "a sample node.js app for heroku",
"main": "venkat1.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"express": "~3.3.4"
},
"engines": {
"node": "0.10.13",
"npm": "1.3.2"
},
"repository": {
"type": "git",
"url": "https://github.com/Mygitusername/myreponame"
},
"keywords": [
"node",
"heroku"
],
"author": "Venkateshwaran",
"license": "MIT",
}
và Procfile nữa.
web: node venkat1.js
Bạn có [file 'package.json'] (https://github.com/heroku/heroku-buildpack-nodejs/blob/v8/bin/ phát hiện # L4) trong ứng dụng của bạn? – matt