質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Git

Gitはオープンソースの分散バージョン管理システム(DVCS)です。

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

GitHub

GitHubは、Gitバージョン管理システムを利用したソフトウェア開発向けの共有ウェブサービスです。GitHub商用プランおよびオープンソースプロジェクト向けの無料アカウントを提供しています。

Q&A

解決済

1回答

1322閲覧

Herokuで「デプロイ」すると拒否されてしまいます。

dog57

総合スコア131

Git

Gitはオープンソースの分散バージョン管理システム(DVCS)です。

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

GitHub

GitHubは、Gitバージョン管理システムを利用したソフトウェア開発向けの共有ウェブサービスです。GitHub商用プランおよびオープンソースプロジェクト向けの無料アカウントを提供しています。

0グッド

0クリップ

投稿2017/11/03 01:29

編集2017/11/05 02:45

Herokuで「デプロイ」しようとし、このようなコマンドを打つとこんなエラーが出ます。

push コマンド

git push heroku master

エラー内容

Counting objects: 45, done. Compressing objects: 100% (25/25), done. Writing objects: 100% (45/45), 9.06 KiB | 0 bytes/s, done. Total 45 (delta 20), reused 36 (delta 18) remote: Compressing source files... done. remote: Building source: remote: remote: -----> Node.js app detected remote: remote: -----> Creating runtime environment remote: remote: NPM_CONFIG_LOGLEVEL=error remote: NPM_CONFIG_PRODUCTION=true remote: NODE_VERBOSE=false remote: NODE_ENV=production remote: NODE_MODULES_CACHE=true remote: remote: -----> Installing binaries remote: engines.node (package.json): 4.2.3 remote: engines.npm (package.json): unspecified (use default) remote: remote: Resolving node version 4.2.3... remote: Downloading and installing node 4.2.3... remote: Detected package-lock.json: defaulting npm to version 5.x.x remote: Bootstrapping npm 5.x.x (replacing 2.14.7)... remote: ERROR: npm is known not to run on Node.js v4.2.3 remote: Node.js 4 is supported but the specific version you're running has remote: a bug known to break npm. Please update to at least 4.7.0 to use this remote: version of npm. You can find the latest release of Node.js at https://nodejs.org/ remote: npm installed remote: ERROR: npm is known not to run on Node.js v4.2.3 remote: Node.js 4 is supported but the specific version you're running has remote: a bug known to break npm. Please update to at least 4.7.0 to use this remote: version of npm. You can find the latest release of Node.js at https://nodejs.org/ remote: ERROR: npm is known not to run on Node.js v4.2.3 remote: Node.js 4 is supported but the specific version you're running has remote: a bug known to break npm. Please update to at least 4.7.0 to use this remote: version of npm. You can find the latest release of Node.js at https://nodejs.org/ remote: /app/tmp/buildpacks/19862b8792e84bd8421ded4660b92dfd1c41d92e19ac0b38c90301adc8ae3e0bd512fa01998af18fc2f0d31a157e9c82e8fdceba1a05e5d29adb8dc2bfaf08e1/lib/failure.sh: line 296: [: : integer expression expected remote: remote: -----> Restoring cache remote: Skipping cache restore (not-found) remote: remote: -----> Building dependencies remote: Installing node modules (package.json + package-lock) remote: ERROR: npm is known not to run on Node.js v4.2.3 remote: Node.js 4 is supported but the specific version you're running has remote: a bug known to break npm. Please update to at least 4.7.0 to use this remote: version of npm. You can find the latest release of Node.js at https://nodejs.org/ 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 immense-refuge-84970. remote: To https://git.heroku.com/immense-refuge-84970.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/immense-refuge-84970.git'

一体、このエラーはどういうことなのででょうか?

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

shimitei

2017/11/03 05:53

書かれている3行のエラー内容の直前あたりにエラーの原因が出力されているはずです。もう少し前の部分までエラー内容を追記して下さい。
dog57

2017/11/03 09:22

追記しました!
shimitei

2017/11/03 10:29

Node.jsアプリのBuild failedでは全部見ないとわからないですね。--> Node.js app detected以降から見せてもらえますか?
dog57

2017/11/05 02:45

遅れましたが、追記致しました。
guest

回答1

0

ベストアンサー

package.jsonに記述しておくと、Herokuで特定バージョンのNode.js、npmを使うように指定できます。
おそらく次のようにNode.js v4.2.3を指定、npmは無指定にしていると思います。

"engines": { "node": "4.2.3" }

npmのバージョンが指定されていないため、Herokuではデフォルトのバージョン(npm 5.x.x)が使われます。

remote: ERROR: npm is known not to run on Node.js v4.2.3

remote: Node.js 4 is supported but the specific version you're running has
remote: a bug known to break npm. Please update to at least 4.7.0 to use this
remote: version of npm. You can find the latest release of Node.js at https://nodejs.org/

ただし、Node.js v4.2.3のバージョンは既知のバグがあってnpmの動作に問題があるようです。
ログにはNode.jsをv4.7.0以上にするように書かれています。

投稿2017/11/05 09:09

shimitei

総合スコア799

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問