npm install g过程中cb() never called!

看见好的文章就收藏,日常工作需要积累,水滴石可穿~
VUE 初始化 npm install 报错npm ERR! cb() never called!
1.VUE 初始化 npm install 报错npm ERR! cb()never called!npm ERR! cb() never called!npm ERR! This is an error withnpm itself. Please report this error at:npm ERR! npm ERR! A complete log of thisrun can be found in:npm ERR!C:\Users\AppData\Roaming\npm-cache_logs\T13_53_25_178Z-debug.log解决办法:尝试 删除项目中的 package-lock.json 文件 和 node_modules 文件夹,然后再尝试 npm install.如果上述操作后依旧报错,请尝试卸载node 及删除C:\Users\AppData\Roaming\npm-cache和npm 文件夹后重新安装node.并配置环境变量(百度搜索node环境变量配置有很多文章我就不啰嗦了)2. VUE 初始化 npm install 报错 .NETFramework 2.0 SDK 文件找不到,请去微软官网下载这个文件 依旧百度搜索(.NETFramework 2.0 SDK 下载)安装后 再进行 npm install.3. VUE 初始化 npm install 如果你尝试了以上所有办法 报其他错误的情况下 可以考虑是否是网络不好,可以尝试使用cnpm 。执行npm install -g cnpm --registry=https://registry.npm.taobao.org安装成功后就可以 将npm改成使用cnpm安装模块了
没有更多推荐了,
加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!npm ERR cb() never called
由 匿名 (未验证)
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):问题:
I have a Node.js app hosted on Heroku. Every time I do a git push heroku I get the following error:
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
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
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++
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
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
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
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 :still-chamber-1286.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to ':still-chamber-1286.git'
The error is in the last few lines:
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 :still-chamber-1286.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to ':still-chamber-1286.git'
I have had no problems with pushing my code to H only since Monday have I had this error.
I have seen similar posts on the web referring to slightly different errors, but haven't seen one with ! [remote rejected] master -> master (pre-receive hook declined) before.
This workaround worked for me:
$ sudo npm cache clean
My node and npm versions are:
For anyone hitting this page around Sept 29th, 2013, there's a closed bug in Node.js 0.10.19 which is causing this error.
If you're on Heroku you should upgrade to 0.10.20
"engines": {
"node": "0.10.20"
Do you have a specific version of "npm" specified under "engines" in your package.json?
Sounds like NPM v1.2.15
(and Heroku has available).
I was getting the same problem with "1.1.x".
I had the same problem with NPM version 1.3.11, and solved it simply by re-running the exact same command multiple times ("npm update -g" in my case). The error popped up for a different package on each subsequent run and eventually everything updated successfully.
For me at least, it seems like it was being caused by a network issue (corrupted downloads). I was also getting an error about an invalid package, which I was able to resolve by deleting all instances of "tmp.tgz".
Edit: (Probably unrelated, but in case this helps anyone: I was using Windows, and started a command prompt as an Administrator after receiving the initial error).
I had the same problem while installing ionic@beta.
I tried the following items and they didn't help me.
npm cache clean
Manually delete cache from %temp%\npm-*
prompt "Run As Administrator"
I solved the problem by installing node-v5.10.1-x64.msi (Previous version was node-v5.9.0-x64.msi) and run an npm cache clean before installing ionic@beta
It worked!
I just had this exactly issue when trying to install the Sage theme for WordPress. When I ran npm install on the theme directory, it failed.
Looking in the dependencies in package.json, I could see that the engine I was running for Node was out of date. Running node -v on the command line showed that I was on v0.10.9, and the latest version of Sage requires >= 0.12.0
So here's the fix for that. These steps are from
Clear your npm cache: sudo npm cache clean -f
Install the latest version of the Node helper: sudo npm install -g n
Tell the helper (n) to install the latest stable version of Node: sudo n stable
You should then get a progress display, after which you will be up to date.
When I ran npm install after doing this, everything worked fine, and I was able to run gulp to build the initial dist directory.
sudo npm cache clean didn't work out for me. Update to the latest version of node helps.
I had node v.5.91 and updated to v6.9.1
sudo npm cache clean --force
Picking up where mdp left, the problem is with node 0.10.19 and npm 1.3.11
I found the easiest way to manage the downgrade to keep things going smoothly to be ,
is a nice tutorial on how to use it. I had my server environment modified and running correctly downgrading from 0.10.19 to 0.10.18 in a matter of minutes with NVM.
Updating the NodeJS
Fixed My Issue.
Run npm install -g npm & npm cache clean
It appears that particular dependency versions can cause this issue. For example, gulp-uglifycss 1.0.7 has this problem (see ).
If you are allowing major or minor version updates in your packages.json via ^ or ~, remove those characters thoughout the file and try another npm install. If it works that time then you'll be alright after you have the fun of narrowing down which package is causing the problem.
brew uninstall node
cd /usr/local
git checkout f7bbdcc /usr/local/Library/Formula/node.rb
brew install node
Find other versions like so:
brew versions node
Run it without thinking
npm cache clean -f
npm install -g n
npm install -g angular-cli
I just globally installed the newest version of NPM and it worked for me.
I guess Clearing npm cache is optional.
npm install -g npm
If you have updated angular cli, npm, node, you don't need to do anything more. Just run the command below to resolve the issue. This command also resolves the issue of "unexpected end of line".
npm install --no-package-lock
It seems like this issue is not occurring with a specific configuration or node version. We experienced it a couple of times when redeploying and suspect the npm servers to cause this issue.
Retrying a couple of times did solve the issue eventually.
Do npm install npm@latest -g to update npm to the latest version.
This fixed the problem for me.
I did do npm cache clean first
There may be two possibilities=>
Try to update your node js and npm.
Permission issue =>
a. Move your solution on c drive in your respective user account
b. Need to run bash or cmd as administrator.
Hope this will resolve your issue
添加新评论o Published 4 months ago
Command line utility that retries
npm install when NPM fails with flaky errors:
npm ERR! cb() never called,
npm ERR! errno ECONNRESET,
npm ERR! shasum check failed,
npm ERR! code EINTEGRITY
This happens sporadically and has been reported many times:
and still fails.
Installation
npm install -g
npm-install-retry
From command-line:
npm-install-retry --wait 500 --attempts 10 -- --production
It has two options wait (defaults to 500) and attempts (default to 10). Everything after -- goes directly to npm.
MIT 2013 - José F. Romaniello

我要回帖

更多关于 npm cb never called 的文章

 

随机推荐