npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

npm ERR! cb() never called!

Installed node on Win 7(Enterprise) 64bit []
installed angular using command : npm install -g @angular/cli

node -v

npm -v

ng -v
Angular CLI: 6.0.8
Node: 8.11.1
OS: win32 x64

Package Version
@angular-devkit/architect 0.6.8
@angular-devkit/core 0.6.8
@angular-devkit/schematics 0.6.8
@schematics/angular 0.6.8
@schematics/update 0.6.8
rxjs 6.2.1
typescript 2.7.2

Now, while creating a new project using “ng new projname” (location D drive)., it gives the following error:

D:\Aj>ng new third
CREATE third/angular.json (3539 bytes)
CREATE third/package.json (1309 bytes)
CREATE third/ (1022 bytes)
CREATE third/tsconfig.json (384 bytes)
CREATE third/tslint.json (2805 bytes)
CREATE third/.editorconfig (245 bytes)
CREATE third/.gitignore (503 bytes)
CREATE third/src/environments/ (51 bytes)
CREATE third/src/environments/environment.ts (631 bytes)
CREATE third/src/favicon.ico (5430 bytes)
CREATE third/src/index.html (292 bytes)
CREATE third/src/main.ts (370 bytes)
CREATE third/src/polyfills.ts (3194 bytes)
CREATE third/src/test.ts (642 bytes)
CREATE third/src/assets/.gitkeep (0 bytes)
CREATE third/src/styles.css (80 bytes)
CREATE third/src/browserslist (375 bytes)
CREATE third/src/karma.conf.js (964 bytes)
CREATE third/src/ (194 bytes)
CREATE third/src/tsconfig.spec.json (282 bytes)
CREATE third/src/tslint.json (314 bytes)
CREATE third/src/app/app.module.ts (314 bytes)
CREATE third/src/app/app.component.html (1141 bytes)
CREATE third/src/app/app.component.spec.ts (988 bytes)
CREATE third/src/app/app.component.ts (207 bytes)
CREATE third/src/app/app.component.css (0 bytes)
CREATE third/e2e/protractor.conf.js (752 bytes)
CREATE third/e2e/src/app.e2e-spec.ts (301 bytes)
CREATE third/e2e/src/app.po.ts (208 bytes)
CREATE third/e2e/tsconfig.e2e.json (213 bytes)
npm WARN deprecated istanbul-lib-hook@1.2.1: 1.2.0 should have been a major vers
ion bump
npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\komkumar\AppData\Roaming\npm-cache_logs\2018-07-10T06_39_
Package install failed, see above.

Tried clearing cache, and running the command again. doesn’t work.
Tried the following steps, but didn’t work:

deleting npm , npm-cache folders from C:\Users\Username\AppData\Roaming
2)uninstall node js
4)install again
run command “npm install -g @angular/cli”
run command “ng new firstproj” gives the same error. “cb() never called”.
Is there any solution for this?

I’m pretty sure this has to do with that awful heisenbug we’ve been hitting recently where the cli just… exits (which is very strange).

Can you reproduce this reliably? Does it happen if you use npm@5.7.0?

this happens every time i try creating new project using “ng new”. Haven’t tried with npm 5.7.0

2018-07-10T06_39_39_241Z-debug.log (147.2 KB)
I have attached the log file

If I may chip in my $0.02.

I have been able to reliably reproduce this behaviour with every npm release from 5.7.0 (inclusive) onward. Latest attempt being 6.2.0 on node@10.6.0.

To reproduce I can take almost any sufficiently large project and then

rm -rf node_modules package-lock.json
npm install

… in order to get the dreaded cb() never called! message.

Where “sufficiently large” means that it seems to need a “certain” number of dependencies. That is, in hoping to perhaps identify a certain dependency as the culprit I have been doing the above repeatedly, starting from zero, adding one dependency at a time until the problem started occurring.

Turn’s out I couldn’t nail it down to a single dependency this way; only the number of dependencies seems to matter, and more disturbingly, when I just hit that “critical mass”, it didn’t even happen all the time. Only a further increase of the number dependencies did turn the problem into becoming a “reliable” occurrence.

Can you put together a package.json/package-lock.json combo that I can reliably reproduce this with?

Sure! Though you won’t actually need the package-lock.json since the steps to reproduce delete it just prior to doing the “npm install”.

That said, I just found that only an “rm -rf node_modules” is also sufficient to reproduce the behaviour.

(And now I’m told I lack the privilege to upload more than one attachment; So, I guess I can upload the package-lock.json in a second reply if you really need it but I’m sure the package.json alone will do the trick).

package.json` (1.4 KB)

If it helps, this happens on macOS Sierra 10.12.6.

Uninstalling and re-installing node (repeating the process multiple number of times) , restarting the system after uninstall, now I am finally able to create a project using “ng new”. I am still not sure about the root cause for this error

Please continue future discussion in [crash] npm ERR! cb() never called!, which is a proper bug report, and this is definitely a bug.