2016-07-05 14 views
5

tôi đã thực hiện theo điện thoại di động góc, https://github.com/angular/mobile-toolkit/blob/master/guides/cli-setup.mdkhông thể đọc thuộc tính 'makeCurrent' không xác định ở góc di động

phiên bản Node v4.4.3 NPM phiên bản 2.15.1

Vấn đề là khi tôi gõ $ ng serve gặp lỗi sau.

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) 
+0

tôi nhận được cùng một vấn đề khi chạy ng build cũng ... NPM -v 3.10.3, nút -v 6.1.0 –

+0

Upgrade góc -nhập phụ thuộc vào package.json của bạn đến 0.104.4 và thực hiện cập nhật npm. Xây dựng ban đầu của bạn sẽ thành công như thế nào bao giờ bất kỳ xây dựng tiến bộ một lần nữa sẽ thất bại. –

Trả lời

7

Ok cuối cùng đã hoạt động. Cập nhật package.json trong thư mục gốc của bạn như dưới đây

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

Ngoài ra thêm

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

sau đó

> npm update 

Điều này sẽ làm cho nó hoạt động trở lại

+0

tuyệt vời, bạn làm cho ngày của tôi. – ppshein

1

tôi đã có thể có được nó làm việc bằng cách cập nhật hai gói được đề cập bởi Aswin.

Mới nhất/phiên bản làm việc vào thời điểm đó là:

"angular2-broccoli-prerender": "0.11.5", 
"angular2-universal":"0.104.5", 
Các vấn đề liên quan