implement i18n in angular2 -TypeError: Cannot read property 'create' of undefined

206 views
Skip to first unread message

sardar nale

unread,
Dec 28, 2016, 8:25:57 AM12/28/16
to Angular
Hi,

I am using angular2 for developing web application. Used below seed project.

I am going to implement i18n(Multi language support) (Link :https://angular.io/docs/ts/latest/cookbook/i18n.html).

I performed below steps : 
1) Execute command - npm install @angular/compiler-cli @angular/platform-server --save
2) Execute command "./node_modules/.bin/ng-xi18n"

1) For first step command execution got below logs 
  npm install @angular/compiler-cli @angular/platform-server --save

+-- UNMET PEER DEPENDENCY rx...@5.0.0-rc.5
`-- UNMET PEER DEPENDENCY tsl...@4.0.2

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsev...@1.0.15: wanted {"os":"darwin","arch"
:"any"} (current: {"os":"win32","arch":"x64"})
npm WARN @angular/co...@2.1.1 requires a peer of rx...@5.0.0-beta.12 but none was installed.
npm WARN @angular/fo...@2.2.4 requires a peer of @angular/co...@2.2.4 but none was installed.
npm WARN @angular/fo...@2.2.4 requires a peer of @angular/com...@2.2.4 but none was installed.
npm WARN @angular/ht...@2.1.1 requires a peer of rx...@5.0.0-beta.12 but none was installed.
npm WARN @angular/rou...@3.1.1 requires a peer of rx...@5.0.0-beta.12 but none was installed.
npm WARN code...@1.0.0-beta.4 requires a peer of tslint@^3.9.0 but none was installed.
npm WARN code...@1.0.0-beta.4 requires a peer of @angular/compiler@~2.2.0 but none was installed.
npm WARN code...@1.0.0-beta.4 requires a peer of @angular/core@~2.2.0 but none was installed.
npm WARN tslint...@2.1.5 requires a peer of tslint@^3.0.0 but none was installed.
npm WARN @angular/compil...@2.4.1 requires a peer of @angular/comp...@2.4.1 but none was installed.
npm WARN @angular/compil...@2.4.1 requires a peer of @angular/co...@2.4.1 but none was installed.

2) For 2nd step command got below error :
I get below error when execute command ng-xi18n 
C:\Projects\temp\PathTrak3\PathTrak>"./node_modules/.bin/ng-xi18n"
TypeError: Cannot read property 'create' of undefined
    at Function.Extractor.create (C:\Projects\temp\PathTrak3\PathTrak\node_modules\@angular\compiler-cli\src\extractor
.js:69:45)
    at extract (C:\Projects\temp\PathTrak3\PathTrak\node_modules\@angular\compiler-cli\src\extract_i18n.js:7:34)
    at Object.main (C:\Projects\temp\PathTrak3\PathTrak\node_modules\@angular\tsc-wrapped\src\main.js:47:16)
    at Object.<anonymous> (C:\Projects\temp\PathTrak3\PathTrak\node_modules\@angular\compiler-cli\src\extract_i18n.js:
14:9)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
Extraction failed

Please find the attached package.json file.
Is it due to version i am using . Kindly suggest.

Thanks,
Sardar Nale

package.json
Reply all
Reply to author
Forward
0 new messages