ngx-translate-extract: no such file or directory on extract on run
If the extract command from the readme is used without creating the necessary directories in the assets folder, then the tool will crash with no such file or directory
.
ngx-translate-extract version: 2.3.4
Full log:
E:\development\goprojects\src\github.com\zlepper\physicalStore\frontend>npm run extract
> frontend@0.0.0 extract E:\development\goprojects\src\github.com\zlepper\physicalStore\frontend
> ngx-translate-extract --input ./src --output ./src/assets/i18n/*.json --clean --sort --format namespaced-json
Extracting strings...
- src/app/app.component.spec.ts
- src/app/app.component.ts
- src/app/app.module.ts
- src/app/app.routing.ts
- src/app/helpers/Queue.ts
- src/app/lists/create-new-list/create-new-list.component.spec.ts
- src/app/lists/create-new-list/create-new-list.component.ts
- src/app/lists/lists.component.spec.ts
- src/app/lists/lists.component.ts
- src/app/lists/open-list/confirm-list-delete/confirm-list-delete.component.spec.ts
- src/app/lists/open-list/confirm-list-delete/confirm-list-delete.component.ts
- src/app/lists/open-list/confirm-list-delete/ValueValidator.ts
- src/app/lists/open-list/create-new-post/create-new-post.component.spec.ts
- src/app/lists/open-list/create-new-post/create-new-post.component.ts
- src/app/lists/open-list/open-list.component.spec.ts
- src/app/lists/open-list/open-list.component.ts
- src/app/lists/open-list/post/edit-post/edit-post.component.spec.ts
- src/app/lists/open-list/post/edit-post/edit-post.component.ts
- src/app/lists/open-list/post/post-remove-confirm/post-remove-confirm.component.spec.ts
- src/app/lists/open-list/post/post-remove-confirm/post-remove-confirm.component.ts
- src/app/lists/open-list/post/post.component.spec.ts
- src/app/lists/open-list/post/post.component.ts
- src/app/lists/open-list/upload-area/upload-area.component.spec.ts
- src/app/lists/open-list/upload-area/upload-area.component.ts
- src/app/login/login.component.spec.ts
- src/app/login/login.component.ts
- src/app/models/list.ts
- src/app/models/post.ts
- src/app/operators/behaviorSubject.ts
- src/app/operators/delayAtLeast.ts
- src/app/services/auth.service.spec.ts
- src/app/services/auth.service.ts
- src/app/services/is-authenticated.guard.spec.ts
- src/app/services/is-authenticated.guard.ts
- src/app/services/lists.service.spec.ts
- src/app/services/lists.service.ts
- src/app/services/local-storage.service.spec.ts
- src/app/services/local-storage.service.ts
- src/app/services/log.pipe.spec.ts
- src/app/services/log.pipe.ts
- src/app/services/services.module.ts
- src/app/services/upload.service.spec.ts
- src/app/services/upload.service.ts
- src/app/sign-up/repeatValidator.ts
- src/app/sign-up/sign-up.component.spec.ts
- src/app/sign-up/sign-up.component.ts
- src/environments/environment.prod.ts
- src/environments/environment.ts
- src/main.ts
- src/polyfills.ts
- src/test.ts
- src/typings.d.ts
- src/app/app.component.html
- src/app/lists/create-new-list/create-new-list.component.html
- src/app/lists/lists.component.html
- src/app/lists/open-list/confirm-list-delete/confirm-list-delete.component.html
- src/app/lists/open-list/create-new-post/create-new-post.component.html
- src/app/lists/open-list/open-list.component.html
- src/app/lists/open-list/post/edit-post/edit-post.component.html
- src/app/lists/open-list/post/post-remove-confirm/post-remove-confirm.component.html
- src/app/lists/open-list/post/post.component.html
- src/app/lists/open-list/upload-area/upload-area.component.html
- src/app/login/login.component.html
- src/app/sign-up/sign-up.component.html
- src/index.html
Extracted 0 strings
Saving: E:\development\goprojects\src\github.com\zlepper\physicalStore\frontend\src\assets\i18n\*.json
- sorted strings
fs.js:652
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: ENOENT: no such file or directory, open 'E:\development\goprojects\src\github.com\zlepper\physicalStore\frontend\src\assets\i18n\*.json'
at Object.fs.openSync (fs.js:652:18)
at Object.fs.writeFileSync (fs.js:1299:33)
at E:\development\goprojects\src\github.com\zlepper\physicalStore\frontend\node_modules\@biesbjerg\ngx-translate-extract\dist\cli\tasks\extract.task.js:93:16
at Array.forEach (native)
at ExtractTask._save (E:\development\goprojects\src\github.com\zlepper\physicalStore\frontend\node_modules\@biesbjerg\ngx-translate-extract\dist\cli\tasks\extract.task.js:59:22)
at ExtractTask.execute (E:\development\goprojects\src\github.com\zlepper\physicalStore\frontend\node_modules\@biesbjerg\ngx-translate-extract\dist\cli\tasks\extract.task.js:32:14)
at Object.<anonymous> (E:\development\goprojects\src\github.com\zlepper\physicalStore\frontend\node_modules\@biesbjerg\ngx-translate-extract\dist\cli\cli.js:111:9)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! frontend@0.0.0 extract: `ngx-translate-extract --input ./src --output ./src/assets/i18n/*.json --clean --sort --format namespaced-json`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the frontend@0.0.0 extract 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\hanse\AppData\Roaming\npm-cache\_logs\2017-11-11T10_19_10_130Z-debug.log
```
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 3
- Comments: 16 (1 by maintainers)
Commits related to this issue
- Fixes #85 — committed to rausche-kuh/ngx-translate-extract by deleted user 3 years ago
ngx-translate-extract -i ./src -o ./src/i18n/da.json ./src/i18n/en.json ./src/i18n/fr.json is a workaround.
Same here.
My friends what works for me like a charm is: “extract-translations”: “ngx-translate-extract --input ./src --output ./src/assets/i18n/en.json ./src/assets/i18n/es.json --clean --sort”
It seems that in windows it does not recognize the *.json pattern