heroku错误:期望另一个键值对
我正在尝试将heroj的应用程序首次部署到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'
我用ssh-keygen -t rsa
创build了新的密钥,并用heroku keys:add
将它们添加到了heroku keys:add
但我仍然得到这个错误。 有人能帮助我吗?
嗯,我弄明白了,这个神秘的错误与package.json文件有关。 基本上,我通过在一个单独的json对象中声明了“engine”字段
{ "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" } }
相反,它应该是这样的:
{ "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" } }