×

Sign in with twitter.

You can follow the user and hashtags.

Share your tips on social media.

Post relative tips.

If you have relative tips, click [Add relative tips] to post.

herokuでnodeを使う際のnodeのバージョン指定のハマりどころ

@kanonji@kanonji 1932 viewer 54 embed viewer embed
{
"author": "",
"name": "try01",
"version": "0.0.0",
"dependencies": {},
"devDependencies": {},
"optionalDependencies": {},
"engines": {
"node": "*"
}
}

`$npm init`で的当に`package.json`を作ると、こんなのになる。どのバージョンでもOKな`"node": "*"`をherokuがうまく解釈せずに`git push heroku master`する段階でエラーになります。

$ git push -u heroku master
Counting objects: 12, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (11/11), done.
Writing objects: 100% (12/12), 1.04 KiB, done.
Total 12 (delta 5), reused 0 (delta 0)

-----> Heroku receiving push
-----> Node.js app detected
-----> Resolving engine versions
! Requested engine node version HEAD branches config description hooks info objects refs slugc_lock does not match available versions: 0.8.1 0.8.0 0.6.18 0.6.17 0.6.16 0.6.15 0.6.14 0.6.13 0.6.12 0.6.11 0.6.10 0.6.8 0.6.7 0.6.6 0.6.5 0.6.3 0.4.10 0.4.7
! Heroku push rejected, failed to compile Node.js app

`"node": "0.6.x"`などバージョンを指定する必要あり。

`Requested engine node version HEAD branches config description hooks info objects refs slugc_lock does not match available versions`

この英文、名詞と思われる単語が続きすぎて何言っているのかよく分からない・・・。バージョンが合ってないのは分かるんだけどさ。

#node #heroku

Click this to change format.

Add relative tips

Users who share this tip.

Comments