gpt4 book ai didi

node.js - npm ERR cb() 从未调用

转载 作者:IT老高 更新时间:2023-10-28 21:45:27 25 4
gpt4 key购买 nike

我有一个托管在 Heroku 上的 Node.js 应用程序。每次我执行 git push heroku 时都会出现以下错误:

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'

错误在最后几行:

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'

我之前将代码推送到 Heroku 没有任何问题;直到星期一才出现这个错误。

我在网上看到过类似的帖子,其中提到了略有不同的错误,但还没有看到有 的帖子! [remote denied] master -> master (pre-receive hook denied) before.

最佳答案

如果你有 npm 5 或更高版本,请先试试这个:

$ sudo npm cache verify

否则:

$ sudo npm cache clean

我的 node 和 npm 版本是:

$ node -v
v0.10.0

$ npm -v
1.2.14

https://docs.npmjs.com/cli/cache

关于node.js - npm ERR cb() 从未调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15393821/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com