Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot read property 'makeCurrent' of undefined in angular mobile

I've done according to angular mobile, https://github.com/angular/mobile-toolkit/blob/master/guides/cli-setup.md

Node version v4.4.3 NPM version 2.15.1

Problem is when I type $ ng serve encounter following error.

Cannot read property 'makeCurrent' of undefined
TypeError: Cannot read property 'makeCurrent' of undefined
    at Object.<anonymous> (/Users/user/Documents/Projects/PWA/hello-mobile/node_modules/angular2-universal/dist/node/node.js:7:35)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/Users/user/Documents/Projects/PWA/hello-mobile/node_modules/angular2-universal/dist/node/index.js:5:17)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/Users/user/Documents/Projects/PWA/hello-mobile/node_modules/angular2-broccoli-prerender/dist/prerender.js:8:28)
    at Module._compile (module.js:409:26)
like image 817
PPShein Avatar asked Jul 05 '16 05:07

PPShein


Video Answer


2 Answers

Ok finally got it working. Update package.json in your root folder like below

"angular2-broccoli-prerender": "0.11.3",
"angular2-universal": "0.104.4",

Also add

"child-process-promise": "^2.0.2",
"optimist": "^0.6.1"

then

> npm update

This will make it working again

like image 158
Aswin S Avatar answered Sep 24 '22 00:09

Aswin S


I was able to get it working by just updating the two packages mentioned by Aswin.

The latest/working versions at the time were:

"angular2-broccoli-prerender": "0.11.5",
"angular2-universal":"0.104.5",
like image 43
Jon Garrard Avatar answered Sep 24 '22 00:09

Jon Garrard