我想一个应用程序的NodeJS部署到Heroku的首次,以下Heroku的说明在这里
当我运行时git push heroku master,它开始编译应用程序,但当它达到100%时,我得到了这个
parse error: Expected another key-value pair at line 18, column 1
! Push rejected, failed to compile Node.js app
To git@heroku.com:agile-sands-7020.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:agile-sands-7020.git'
Run Code Online (Sandbox Code Playgroud)
我已经创建了新的密钥ssh-keygen -t rsa
并将它们添加到heroku heroku keys:add但我仍然收到此错误.有谁可以帮助我吗?
啊,我想通了,这个神秘的错误与package.json文件有关.基本上我通过在一个单独的json对象中声明它来破坏"引擎"字段
{
"name": "elegant-insults",
"version": "0.0.0",
"description": "Insult eachother in the most elegant of ways",
"main": "server.js",
"dependencies": {
"socket.io": "~0.9.16",
"xml2js": "~0.4.1",
"express": "~3.4.8"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js"
},
"author": "roman-sharf",
"license": "ISC",
"repository": {
"type": "git",
"url": "git@heroku.com:elegant-insults.git"
}
},
{
"engines": {
"node": "0.10.x"
}
}
Run Code Online (Sandbox Code Playgroud)
相反它应该是这样的:
{
"name": "elegant-insults",
"version": "0.0.0",
"description": "Insult eachother in the most elegant of ways",
"main": "server.js",
"dependencies": {
"socket.io": "~0.9.16",
"xml2js": "~0.4.1",
"express": "~3.4.8"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js"
},
"author": "roman-sharf",
"license": "ISC",
"engines": {
"node": "0.10.x"
},
"repository": {
"type": "git",
"url": "git@heroku.com:elegant-insults.git"
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3649 次 |
| 最近记录: |