Eu tenho um aplicativo Node.js hospedado no Heroku. Sempre que faço um git push heroku
, recebo o seguinte erro:
Counting objects: 14, done.
Delta compression using up to 6 threads.
Compressing objects: 100% (12/12), done.
Writing objects: 100% (12/12), 1.20 KiB, done.
Total 12 (delta 8), reused 0 (delta 0)
-----> Node.js app detected
-----> Resolving engine versions
Using Node.js version: 0.6.20
Using npm version: 1.2.12
-----> Fetching Node.js binaries
-----> Vendoring node into slug
-----> Installing dependencies with npm
npm http GET https://registry.npmjs.org/pg/0.6.15
npm http GET https://registry.npmjs.org/socket.io
npm http 200 https://registry.npmjs.org/pg/0.6.15
npm http GET https://registry.npmjs.org/pg/-/pg-0.6.15.tgz
npm http 200 https://registry.npmjs.org/socket.io
npm http GET https://registry.npmjs.org/socket.io/-/socket.io-0.9.13.tgz
npm http 200 https://registry.npmjs.org/pg/-/pg-0.6.15.tgz
npm http 200 https://registry.npmjs.org/socket.io/-/socket.io-0.9.13.tgz
npm http GET https://registry.npmjs.org/socket.io-client/0.9.11
npm http GET https://registry.npmjs.org/policyfile/0.0.4
npm http GET https://registry.npmjs.org/base64id/0.1.0
npm http GET https://registry.npmjs.org/redis/0.7.3
npm http GET https://registry.npmjs.org/generic-pool/1.0.9
npm http 200 https://registry.npmjs.org/policyfile/0.0.4
npm http GET https://registry.npmjs.org/policyfile/-/policyfile-0.0.4.tgz
npm http 200 https://registry.npmjs.org/base64id/0.1.0
npm http GET https://registry.npmjs.org/base64id/-/base64id-0.1.0.tgz
npm http 200 https://registry.npmjs.org/generic-pool/1.0.9
npm http GET https://registry.npmjs.org/generic-pool/-/generic-pool-1.0.9
.tgz
npm http 200 https://registry.npmjs.org/socket.io-client/0.9.11
npm http GET https://registry.npmjs.org/socket.io-client/-/socket.io-clie
nt-0.9.11.tgz
npm http 200 https://registry.npmjs.org/redis/0.7.3
npm http GET https://registry.npmjs.org/redis/-/redis-0.7.3.tgz
npm http 200 https://registry.npmjs.org/policyfile/-/policyfile-0.0.4.tgz
npm http 200 https://registry.npmjs.org/base64id/-/base64id-0.1.0.tgz
npm http 200 https://registry.npmjs.org/generic-pool/-/generic-pool-1.0.9
.tgz
npm http 200 https://registry.npmjs.org/socket.io-client/-/socket.io-clie
nt-0.9.11.tgz
npm http 200 https://registry.npmjs.org/redis/-/redis-0.7.3.tgz
> pg@0.6.15 install /tmp/build_36us8733h7kkr/node_modules/pg
> node-waf configure build || (exit 0)
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : not found
Checking for node prefix : ok /tmp/node-node-nNUw
Checking for program pg_config : /usr/bin/pg_config
'configure' finished successfully (0.058s)
Waf: Entering directory `/tmp/build_36us8733h7kkr/node_modules/pg/build'
[1/2] cxx: src/binding.cc -> build/Release/src/binding_1.o
[2/2] cxx_link: build/Release/src/binding_1.o -> build/Release/binding.no
de
Waf: Leaving directory `/tmp/build_36us8733h7kkr/node_modules/pg/build'
'build' finished successfully (0.492s)
npm http GET https://registry.npmjs.org/uglify-js/1.2.5
npm http GET https://registry.npmjs.org/ws
npm http GET https://registry.npmjs.org/xmlhttprequest/1.4.2
npm http GET https://registry.npmjs.org/active-x-obfuscator/0.0.1
npm http 200 https://registry.npmjs.org/active-x-obfuscator/0.0.1
npm http GET https://registry.npmjs.org/active-x-obfuscator/-/active-x-ob
fuscator-0.0.1.tgz
npm http 200 https://registry.npmjs.org/uglify-js/1.2.5
npm http GET https://registry.npmjs.org/uglify-js/-/uglify-js-1.2.5.tgz
npm http 200 https://registry.npmjs.org/xmlhttprequest/1.4.2
npm http GET https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1
.4.2.tgz
npm http 200 https://registry.npmjs.org/ws
npm http GET https://registry.npmjs.org/ws/-/ws-0.4.25.tgz
npm http 200 https://registry.npmjs.org/active-x-obfuscator/-/active-x-ob
fuscator-0.0.1.tgz
npm http 200 https://registry.npmjs.org/uglify-js/-/uglify-js-1.2.5.tgz
npm http 200 https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1
.4.2.tgz
npm http 200 https://registry.npmjs.org/ws/-/ws-0.4.25.tgz
npm http GET https://registry.npmjs.org/zeparser/0.0.5
npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/tinycolor
npm http GET https://registry.npmjs.org/options
npm http 200 https://registry.npmjs.org/zeparser/0.0.5
npm http GET https://registry.npmjs.org/zeparser/-/zeparser-0.0.5.tgz
npm http 200 https://registry.npmjs.org/options
npm http GET https://registry.npmjs.org/options/-/options-0.0.3.tgz
npm http 200 https://registry.npmjs.org/tinycolor
npm http GET https://registry.npmjs.org/tinycolor/-/tinycolor-0.0.1.tgz
npm http 200 https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/commander/-/commander-0.6.1.tgz
npm http 200 https://registry.npmjs.org/zeparser/-/zeparser-0.0.5.tgz
npm http 200 https://registry.npmjs.org/options/-/options-0.0.3.tgz
npm http 200 https://registry.npmjs.org/tinycolor/-/tinycolor-0.0.1.tgz
npm http 200 https://registry.npmjs.org/commander/-/commander-0.6.1.tgz
> ws@0.4.25 install /tmp/build_36us8733h7kkr/node_modules/socket.io/node_
modules/socket.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory `/tmp/build_36us8733h7kkr/node_modules/socket.io
/node_modules/socket.io-client/node_modules/ws/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
SOLINK_MODULE(target) Release/obj.target/bufferutil.node
SOLINK_MODULE(target) Release/obj.target/bufferutil.node: Finished
COPY Release/bufferutil.node
CXX(target) Release/obj.target/validation/src/validation.o
SOLINK_MODULE(target) Release/obj.target/validation.node
SOLINK_MODULE(target) Release/obj.target/validation.node: Finished
COPY Release/validation.node
make: Leaving directory `/tmp/build_36us8733h7kkr/node_modules/socket.io/
node_modules/socket.io-client/node_modules/ws/build'
npm ERR! cb() never called!
npm ERR! not ok code undefined
npm ERR! cb() never called!
npm ERR! not ok code 1
! Failed to install --production dependencies with npm
! Heroku push rejected, failed to compile Node.js app
To git@heroku.com:still-chamber-1286.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:still-chamber-1286.git'
O erro está nas últimas linhas: npm ERR! cb () nunca ligou! npm ERR! não ok código indefinido npm ERR! cb () nunca ligou! npm ERR! não ok código 1! Falha ao instalar as dependências --production com o npm! Push Heroku rejeitado, falha ao compilar o aplicativo Node.js.
To git@heroku.com:still-chamber-1286.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:still-chamber-1286.git'
Não tive problemas em enviar meu código para o Heroku antes; somente desde segunda-feira tenho esse erro.
Vi posts semelhantes na web referindo-se a erros ligeiramente diferentes, mas nunca vi um com ! [remote rejected] master -> master (pre-receive hook declined)
antes.
"engines": { "node": "0.8.x" }
ao meu package.json
erro corrigido para mim.
"engines": { "node": "0.6.x" }
entrado package.json
, eu simplesmente tive que mudar de 0.6.x
para0.8.x
$> npm install -g npm
), pois recebia avisos de que os pacotes esperavam uma versão superior de qualquer maneira na saída do console.
! [remote rejected] master -> master (pre-receive hook declined)