martinroob / ngx-i18nsupport

Some tooling to be used for Angular i18n workflows
MIT License
283 stars 69 forks source link

Problem running the npm script #170

Closed rissom closed 4 years ago

rissom commented 4 years ago

I followed the tutorial a while ago and everything worked as expected. However, I now cleaned up a few things and reinstalled xliffmerge, again following the tutorial page. Using my old trusted npm scipt command, (or the even newly installed script command) I get an error:

ERROR: language "C:\www\OXPV-BRB-DB\frontend\node_modules\@ngx-i18nsupport\ngx-i18nsupport\xliffmerge\xliffmerge" is not valid
npm ERR! code ELIFECYCLE
npm ERR! errno 4294967295
npm ERR! frontend@0.0.1 i18n: `ng xi18n --output-path ./src/locale && xliffmerge --profile xliffmerge.json en de`
npm ERR! Exit status 4294967295
npm ERR!
npm ERR! Failed at the frontend@0.0.1 i18n script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\thorsten.rissom\AppData\Roaming\npm-cache\_logs\2020-07-22T16_13_44_537Z-debug.log

Funny enough I can execute the two parts of the npm skript seperately and they seem to work. I should probably mention that I work on Windows-system. The log file the error message refers to looks like this:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'i18n' ]
2 info using npm@6.9.0
3 info using node@v10.16.3
4 verbose run-script [ 'prei18n', 'i18n', 'posti18n' ]
5 info lifecycle frontend@0.0.1~prei18n: frontend@0.0.1
6 info lifecycle frontend@0.0.1~i18n: frontend@0.0.1
7 verbose lifecycle frontend@0.0.1~i18n: unsafe-perm in lifecycle true
8 verbose lifecycle frontend@0.0.1~i18n: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\www\OXPV-BRB-DB\frontend\node_modules\.bin;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\MATLAB\MATLAB Compiler Runtime\v82\runtime\win64;C:\Program Files\nodejs\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Users\thorsten.rissom\AppData\Local\Microsoft\WindowsApps;C:\Users\thorsten.rissom\AppData\Roaming\npm;C:\Users\thorsten.rissom\AppData\Local\Programs\Git\cmd;C:\xampp\php;C:\Users\thorsten.rissom\AppData\Local\ComposerSetup\bin;C:\Users\thorsten.rissom\AppData\Roaming\Composer\vendor\bin
9 verbose lifecycle frontend@0.0.1~i18n: CWD: C:\www\OXPV-BRB-DB\frontend
10 silly lifecycle frontend@0.0.1~i18n: Args: [ '/d /s /c',
10 silly lifecycle   'ng xi18n --output-path ./src/locale && xliffmerge --profile xliffmerge.json en de' ]
11 silly lifecycle frontend@0.0.1~i18n: Returned: code: 4294967295  signal: null
12 info lifecycle frontend@0.0.1~i18n: Failed to exec i18n script
13 verbose stack Error: frontend@0.0.1 i18n: `ng xi18n --output-path ./src/locale && xliffmerge --profile xliffmerge.json en de`
13 verbose stack Exit status 4294967295
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:198:13)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:198:13)
13 verbose stack     at maybeClose (internal/child_process.js:982:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid frontend@0.0.1
15 verbose cwd C:\www\OXPV-BRB-DB\frontend
16 verbose Windows_NT 10.0.18363
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "i18n"
18 verbose node v10.16.3
19 verbose npm  v6.9.0
20 error code ELIFECYCLE
21 error errno 4294967295
22 error frontend@0.0.1 i18n: `ng xi18n --output-path ./src/locale && xliffmerge --profile xliffmerge.json en de`
22 error Exit status 4294967295
23 error Failed at the frontend@0.0.1 i18n script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 4294967295, true ]

Any ideas, what the problem could be?

Best Regards,

Thorsten Rissom

rissom commented 4 years ago

The scripts look like this:

  "scripts": {
...,
    "i18n": "ng xi18n --output-path ./src/locale && xliffmerge --profile xliffmerge.json en de",
    "extract-i18n": "ng xi18n Frontend --i18n-format xlf --output-path i18n --i18n-locale de && ng run Frontend:xliffmerge",
...
rissom commented 4 years ago

Ok, I solved it. The problem was that I had changed the path for the .xlif files before. I first tested both parts seperately until they worked: "i181": "ng xi18n --output-path ./src/locale", "i182": "ng run Frontend:xliffmerge --profile xliffmerge.json", And then combined them to: "i18n": "ng xi18n --output-path ./src/locale && ng run Frontend:xliffmerge --profile xliffmerge.json"